Kick all Plz Help
#2

use a loop for that
pawn Код:
for(new i; i < MAX_PLAYERS; ++i)
    {

}
pawn Код:
CMD:kickall(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Aval Bayad login Koni Ghabl Az inke Az CMD Ha Estefade Koni.");
    for(new i = 0; i < MAX_PLAYERS; i++))
    {
        if(PlayerInfo[playerid][pAdmin] >= 5) // note that this command can only be done by admin level 5+
        {
            if(IsPlayerConnected(i))
            {
                    if(sscanf(params, "s[128]",params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kickall [reason]");
                    format(string, sizeof(string), "{FF0000}[Admin]{FF6347} All Players has been kicked by %s, reason: %s", NORPN(playerb), NORPN(playerid), params);
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    format(string, sizeof(string), "{FF0000}[Admin]{FF6347} All Players has been kicked by %s (%s), reason: %s", NORPN(playerb), NORPN(playerid), RPIP(playerid), params);
                    Log("logs/kick.log", string);
                    FixedKick(i);

            } else return SendClientMessage(playerid,-1,"There Are No Players Connected.");
        }
    }
    return 1;
}
Reply


Messages In This Thread
Kick all Plz Help - by Airblog - 17.12.2014, 17:25
Re: Kick all Plz Help - by JeaSon - 17.12.2014, 17:38
Re: Kick all Plz Help - by Threshold - 18.12.2014, 02:14

Forum Jump:


Users browsing this thread: 1 Guest(s)