How to check if the player typed a param or if its empty?
#5

Quote:
Originally Posted by Babul
Посмотреть сообщение
this
pawn Код:
CMD:kick(playerid, params[])
{
    new id;
    new reason[64];
        if(PlayerInfo[playerid][AdminLevel] >= 1)
        {
            if(!sscanf(params, "uS(no Reason given)[64]", id, reason))
            {
                new string[256];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "Administrator %s has just kicked %s for reason %s", name, PlayerName, reason);
                ProxDetector(10000000000.0, playerid, string, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF);
                Kick(id);
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /kick [PlayerId/PartOfName] (Reason)");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}
thanks
Reply


Messages In This Thread
How to check if the player typed a param or if its empty? - by milanosie - 04.02.2012, 09:30
Re: How to check if the player typed a param or if its empty? - by Konstantinos - 04.02.2012, 09:31
Re: How to check if the player typed a param or if its empty? - by milanosie - 04.02.2012, 09:33
Re: How to check if the player typed a param or if its empty? - by Babul - 04.02.2012, 09:41
Re: How to check if the player typed a param or if its empty? - by milanosie - 04.02.2012, 09:48

Forum Jump:


Users browsing this thread: 2 Guest(s)