Making a /kick command
#4

Quote:
Originally Posted by ColdIce
Посмотреть сообщение
pawn Код:
dcmd_kick(playerid,params[])
{
    if(AccInfo[playerid][LoggedIn] == 1)

    {
        if(AccInfo[playerid][Level] >= 3)
        {
            new Index;
            new tmp[256];  tmp  = strtok(params,Index);
            new tmp2[256]; tmp2 = strtok(params,Index);
            if(!strlen(params)) return
            SendClientMessage(playerid, LIGHTBLUE2, "Usage: /kick [PlayerID] [Reason]") &&
            SendClientMessage(playerid, orange, "Function: Will Kick the specified player");
            new player1;
            new string[128];
            new playername[MAX_PLAYER_NAME];
            new adminname [MAX_PLAYER_NAME];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
             {
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));
                SendCommandToAdmins(playerid,"Kick");
                if(!strlen(tmp2))
                {
                format(string,sizeof(string),"|- %s has been kicked by Administrator %s | Reason: Not Specified -|",playername,adminname);
                SendClientMessageToAll(grey,string);
                SaveIn("KickLog",string);
                print(string);
                return Kick(player1);
                }
                else
                {
                format(string,sizeof(string),"|- %s has been kicked by Administrator %s | Reason: %s -|",playername,adminname,params[2]);
                SendClientMessageToAll(grey,string);
                SaveIn("KickLog",string); print(string);
                return Kick(player1);
                }
            }
            else return ErrorMessages(playerid, 3);
        }
        else return ErrorMessages(playerid, 1);
    }
    else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
I am dissapointed at how you just copy this from GodFather and put it here, it will most likely return a bunch of errors! Plus a low ammount of users use this low and antiquated system, better to use the modern!
Reply


Messages In This Thread
Making a /kick command - by gamerhead - 22.05.2011, 18:47
Respuesta: Making a /kick command - by admantis - 22.05.2011, 18:52
Re: Making a /kick command - by ColdIce - 22.05.2011, 18:54
Respuesta: Re: Making a /kick command - by admantis - 22.05.2011, 18:55
Re: Making a /kick command - by ColdIce - 22.05.2011, 18:56
Re: Making a /kick command - by jameskmonger - 22.05.2011, 18:56
Respuesta: Re: Making a /kick command - by admantis - 22.05.2011, 18:59
Re: Making a /kick command - by fissekarl - 22.05.2011, 19:53
Respuesta: Re: Making a /kick command - by admantis - 22.05.2011, 19:57
Re: Respuesta: Making a /kick command - by Madsen - 22.05.2011, 20:03

Forum Jump:


Users browsing this thread: 6 Guest(s)