29.05.2014, 14:02
i use /warn <id> and its kicking player, help
pawn Код:
CMD:warn(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] < 3 && !IsPlayerAdmin(playerid)) return SendClientMessage( playerid, -1, "You Must Be Level 2 To Use This Command");
new ID, R[200], string[100];
new WarnC[MAX_PLAYERS];
new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(ID, name2, sizeof(name2));
if(sscanf(params, "is[200]", ID, R)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /warn [playerid] [Reason]");
{
if(WarnC[ID] == 3) return KickPlayer(ID);
{
format(string, sizeof(string), "Administrator %s (%d) Has Kicked %s (%d) For Reason : %s (Warning : %d/3)", name,playerid,name2,ID,R,WarnC);
SendClientMessageToAll(0xFF1493FF, string);
KickPlayer(ID);
}
if(ID != INVALID_PLAYER_ID)
{
{
format(string, sizeof(string), "Administrator %s (%d) Has Warned %s (%d) For Reason : %s (Warning : %d/3)", name,playerid,name2,ID,R,WarnC);
SendClientMessageToAll(0xFF1493FF, string);
WarnC[ID]++;
}
}
else SendClientMessage(playerid, 0xFF0000AA, "ID Not Connected.");
}
return 1;
}