Skip to content

Commit

Permalink
CTF: Log flag events to players and server
Browse files Browse the repository at this point in the history
  • Loading branch information
rtxa committed Aug 5, 2024
1 parent 3e1919e commit ef4747b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion valve/addons/amxmodx/scripting/agmodx_ctf.sma
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ public OnCapturePointTouch(touched, toucher) {
}

client_print(0, print_center, "%l", CTF_ML_FLAGCAPTURED[flagStealedTeam], toucher);
client_print(0, print_console, "%l", CTF_ML_FLAGCAPTURED[flagStealedTeam], toucher);
log_amx("%l", CTF_ML_FLAGCAPTURED[flagStealedTeam], toucher);

Speak(0, fmt("%l", CTF_ML_SND_TEAMSCORES[toucherTeam]));
}

Expand Down Expand Up @@ -707,6 +710,8 @@ public OnFlagTouch(touched, toucher) {

// alert/notify players that flag has return to base
client_print(0, print_center, "%l", CTF_ML_FLAGRETURNED[playerTeam], toucher);
client_print(0, print_console, "%l", CTF_ML_FLAGRETURNED[playerTeam], toucher);
log_amx("%l", CTF_ML_FLAGRETURNED[playerTeam], toucher);
}
}

Expand All @@ -718,6 +723,8 @@ public OnFlagTouch(touched, toucher) {
Player_TakeFlag(toucher, touched);

client_print(0, print_center, "%l", CTF_ML_YOUHAVEFLAG[flagTeam], toucher);
client_print(0, print_console, "%l", CTF_ML_YOUHAVEFLAG[flagTeam], toucher);
log_amx("%l", CTF_ML_YOUHAVEFLAG[flagTeam], toucher);

// Alert flag sound:
// Player who pick the flag: ctf/youhavetheflag.wav
Expand Down Expand Up @@ -908,7 +915,8 @@ public DropFlag(id) {

// Notify players that the player has lost the flag
client_print(0, print_center, "%l", CTF_ML_FLAGLOST[flagTeam], id);
console_print(0, "%l", CTF_ML_FLAGLOST[flagTeam], id);
client_print(0, print_console, "%l", CTF_ML_FLAGLOST[flagTeam], id);
log_amx("%l", CTF_ML_FLAGLOST[flagTeam], id);
}

public CmdDropFlag(id, level, cid) {
Expand Down

0 comments on commit ef4747b

Please sign in to comment.