09.03.2013, 17:26
Add pWarns.
So each time you warn him/her the warn will be added
Example
pWarns
add this when you warn him/her
pWarns[playerid]++;
And add for example under OnPlayerUpdate
Cut the code bit down
Here is an example of entire command (not tested)
So each time you warn him/her the warn will be added
Example
pWarns
add this when you warn him/her
pWarns[playerid]++;
And add for example under OnPlayerUpdate
Код:
if(pWarns[playerid] == 3) { Ban(playerid); return 1; }
Код:
if(dini_Int(aFile,"Admin") >= 3) { SendClientMessage(playerid,0xFF0000AA,"Usa: /warn <id/nome> <motivo> | /swarn <id/nome>"); } if(0 < dini_Int(aFile,"Admin") < 3) { SendClientMessage(playerid,0xFF0000AA,"Comando abilitato agli Admin da Liv.3 in poi."); } if(dini_Int(aFile,"Admin") == 0) { SendClientMessage(playerid,0xFF0000AA,"Comando abilitato agli Admin."); }
Here is an example of entire command (not tested)
Код:
COMMAND:warn(playerid, params[]) { new pid, reason[105]; if(PlayerInfo[playerid][pAdminlevel] >= 1) return SendClientMessage(playerid, 0xAAAAAAAA, "You are not admin or the required level."); if(sscanf(params, "us", pid, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "/warn [playerid/name] [reason]"); if(IsPlayerConnected(pid) && pid != INVALID_PLAYER_ID && pid != playerid) { new adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME], string[180]; GetPlayerName(pid, paramname, sizeof(paramname)); GetPlayerName(playerid, adminname, sizeof(adminname)); format(string, sizeof(string), "%s has been warned by %s for: %s", paramname, adminname, reason); pWarns[pid]++; SendClientMessageToAll(AdminColor, string); Kick(pid); } else return SendClientMessage(playerid, 0xFFFFFFFF, "This player is not connected Or Is Yourself."); return 1; }