SA-MP Forums Archive
[HELP] /kickall - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] /kickall (/showthread.php?tid=287597)



[HELP] /kickall - Swizzzy - 03.10.2011

Well i need to know how to make a /kick command & a /kickall command.

If you could possibly post a code or anything to help me.

Many thanks,

Swizzzy.


Re: [HELP] /kickall - Laronic - 03.10.2011

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;
}



Re: [HELP] /kickall - Swizzzy - 03.10.2011

Quote:
Originally Posted by CyberGhost
Посмотреть сообщение
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;
}
Lol,Erm what about the /kick command.


Re: [HELP] /kickall - Laronic - 03.10.2011

Quote:
Originally Posted by Swizzzy
Посмотреть сообщение
Lol,Erm what about the /kick command.
Sorry :P I updated my first post.