16.11.2011, 10:52
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:
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.");
}