Should return a value?
#4

pawn Код:
dcmd_kick(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, COLOUR_RED, "You need to be admin to use this command");
    else
    {
            new Index;
            new tmp[256];  tmp  = strtok(params,Index);
            new tmp2[256]; tmp2 = strtok(params,Index);
            if(!strlen(params)) return
            SendClientMessage(playerid, COLOUR_RED, "Usage: /kick [ID] [Reason]") &&
            SendClientMessage(playerid, COLOUR_RED, "NOTE: You don't have to put the reason if you don't want to");
            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 && (PlayerInfo[player1][AdminLevel]))
            {
                GetPlayerName(player1, playername, sizeof(playername));
                GetPlayerName(playerid, adminname, sizeof(adminname));
                if(!strlen(tmp2))
                {
                    format(string,sizeof(string),"%s got kicked by Administrator %s . Reason:No reason given",playername,adminname);
                    SendClientMessageToAll(COLOUR_ORANGE,string);
                    Kick(player1);
                }
                else
                {
                    format(string,sizeof(string),"%s got kicked by Administrator %s . Reason: %s.",playername,adminname,params[2]);
                    SendClientMessageToAll(COLOUR_ORANGE,string);
                    Kick(player1);
                }
            }
        }
    }
    return 1;
}
The 'Kick' function does not return any specified value.
Reply


Messages In This Thread
Should return a value? - by Mean - 28.10.2010, 07:46
Re: Should return a value? - by Cameltoe - 28.10.2010, 08:00
Re: Should return a value? - by Mean - 28.10.2010, 08:01
Re: Should return a value? - by Retardedwolf - 28.10.2010, 08:02
Re: Should return a value? - by Mean - 28.10.2010, 08:14
Re: Should return a value? - by Retardedwolf - 28.10.2010, 08:17

Forum Jump:


Users browsing this thread: 1 Guest(s)