31.03.2014, 22:49
pawn Код:
if(pInfo[playerid][Adminlevel] >= 1)
{
if(strcmp(text,"!warn",true,5) == 0)
{
new ID,reason[50];
if(sscanf(text[6],"us[50]",ID,reason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: !warn (Player Name/ID) (Reason)");
return 0;
}
if(ID == INVALID_PLAYER_ID)
{
format(string,sizeof(string),"ID %d is not connected to the server.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 0;
}
if(WarnTimes[ID] >= 2)
{
format(string,sizeof(string),"%s(%d) has been auto kicked from the server because he has reached maximum warnings [3/3 Warnings].",GetName(ID),ID);
SendClientMessageToAll(COLOR_PINK,string);
format(string, sizeof(string), "~W~You Have Been ~R~Kicked ~W~From The Server");
GameTextForPlayer(ID ,string, 99999999999999999999999, 3);
KickTime[ID] = 3;
return 0;
}
else
{
++WarnTimes[ID];
format(string,sizeof(string),"%s(%d) has warned %s(%d) reason: %s. [%d/3 Warnings].",GetName(playerid),playerid,GetName(ID),ID,reason,WarnTimes[ID]);
SendClientMessageToAll(COLOR_PINK,string);
}
}
return 0;
}