[HELP] /kickall
#1

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.
  • I use ZCMD so it'll need to be in this format " CMD:kick(playerid, params[]) " Ect.Ect.
  • In the kickall command make the RCON Admin immune from it.

Many thanks,

Swizzzy.
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)