24.10.2018, 20:08
Loop through all online players and if targetid does not equal to i then send the message. You may want to consider using strlib's sprintf function for formatting your SendClientMessage. I have purposefully put an error or two into either of the methods. You've just got to spot them, to hopefully get your brain thinking
Non-Foreach Method:
Foreach Method:
Non-Foreach Method:
Код:
for (new i; i <= GetPlayerPoolSize(); i++) { if(IsPlayerConnected(playerid)) { if(i != targetid) { SendClientMessage(i, -1, sprintf("AdmCmds: %s was kicked by %s, reason: %s", name, adminname, reason)); } } }
Код:
foreach (new i : Player) { if(i != targetid) { SendClientMessage(i, -1, sprintf("AdmCmds: %s was kicked by %s, reason: %s", name, adminname, reason)); } }