26.10.2009, 21:53
Hello, Is there a way that I can kick all players without typing /kick all the time? I'm looking for the bit of code I need to put in
if(strcmp(cmdtext, "/kickall") == 0)
{
for(new id = 0; id < MAX_PLAYERS; id++)
{
if(IsPlayerConnected(id))
{
Kick(id);
}
}
}
dcmd_kickall(playerid, params[]) { if (IsPlayerAdmin(playerid)) { for (new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i) && !IsPlayerAdmin(i)) { Kick(i); } } } }
ZCMD:kickall(playerid,params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid)
{
foreach(Player,i)
{
if(!IsPlayerAdmin(i)) Kick(i);
}
}
return 1;
}