16.09.2014, 00:18
Hi, this is my problem: the server kick all players, when we give more than three warnings to a rule-breaker
This is the CMD:
please help me 
sorry for my bad english, I'm Mexican
This is the CMD:
Код:
CMD:warn(playerid,params[]) { if(pInfo[playerid][pLogged] == 1) { if(pInfo[playerid][pAdminLevel] >= 1 || IsPlayerAdmin(playerid)) { new targetid,reason[105],string[256]; if(sscanf(params, "us[105]", targetid, reason)) return SendClientMessage(playerid,-1,""chat" /warn [playerid] [reason]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online"); new sentstring[128]; pInfo[targetid][pWarnings]++; format(string,sizeof(string), "%s %s warned you\nReason: %s\nWarning Number: %i",GetAdminName(playerid),PlayerName(playerid), reason, pInfo[targetid][pWarnings]); ShowPlayerDialog(targetid,DIALOG_WARN,DIALOG_STYLE_MSGBOX,"Warning",string,"I Understand",""); format(sentstring,sizeof(sentstring), ""chat""COL_RED" %s %s has warned %s Reason: %s (%i / 3)",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason,pInfo[targetid][pWarnings]); SendClientMessageToAll(-1,sentstring); if(pInfo[targetid][pWarnings] >= 3) { format(string, sizeof(string), ""chat""COL_RED" %s %s has kicked %s [Reason: %s][3 Warnings EXCEEDED]",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason); SendClientMessageToAll(-1,string); SCM(targetid, -1, ""COL_LIGHTBLUE" You have Been Kicked Because your Warns EXCEEDED 3 "); SetTimerEx("WARN_KICK",2000,0,"i",targetid); } } else { SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!"); } } else if(pInfo[playerid][pLogged] == 0) { SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!"); printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid)); Kick(playerid); } return 1; } forward WARN_KICK(); public WARN_KICK() { for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { Kick(i); } } return 1; }

sorry for my bad english, I'm Mexican
