pawn Код:
COMMAND:kickall(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && !IsPlayerAdmin(i))
{
Kick(i);
}
//Everyone except RCON admin got kicked
return true;
}
Edit:
i just saw the /kickall command. Here is the /kick command, using zmcd & sscanf!
pawn Код:
COMMAND:kick(playerid, params[])
{
new targetid, reason[128], string[128];
if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /kick (id/name) (reason)");
{
new playername[24], targetname[24];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
format(string, sizeof(string), "%s kicked %s because %s", playername, targetname, reason);
SendClientMessageToAll(0xFF0000AA, string);
Kick(targetid);
}
return true;
}