Warn Command
#1

Hello.I need little help.How to add in command warn.When i give player 7 warns to kick him how to add it?

here is command:
pawn Код:
CMD:warn(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][pAdminLevel] >= 3)
        {
            if(!sscanf(params, "u", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "You have been warned by %s ", name);
                SendClientMessage(id, 0xD8D8D8FF, string);
                format(string, sizeof(string), "You have warn %s ", PlayerName);
                SendClientMessage(playerid, 0xD8D8D8FF, string);
                PlayerInfo[playerid][pWarns] = PlayerInfo[playerid][pWarns] +1;
                return 1;
            }
            else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /warn [PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
    }
    else return SendClientMessage(playerid, 0xD8D8D8FF, "Player is not connected.");
}
Reply
#2

Something like that
pawn Код:
if(PlayerInfo[playerid][pWarns] == 7)
{
    Kick(playerid);
}
Reply
#3

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
Something like that
pawn Код:
if(PlayerInfo[playerid][pWarns] == 7)
{
    Kick(playerid);
}
aha i know.Thanks for giving base
Reply
#4

Your Welcome!
Reply
#5

Kostas always helping rep ++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)