pawn Код:
new Warnings[MAX_PLAYERS]; // TOP
Warnings[playerid] = 0; // OnPlayerConnect
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_WARN) //
{
if(response==0) return SendClientMessage(playerid,COLOR_RED,"Operation aborted");
if(response==1)
{
if(!strlen(inputtext)) return SendClientMessage(playerid,COLOR_RED,"You didn't type anything in the box");
new pID = clickedplayerid;
new wName[MAX_PLAYER_NAME];
GetPlayerName(pID,wName,sizeof(wName));
new string[120];
format(string,sizeof(string),"%s(%d) has been warned by an admin.Reason:%s",wName,pID,inputtext);
SendClientMessageToAll(COLOR_RED,string);
Warnings[pID] += 1;
if(Warnings[pID] >= 3)
{
SendClientMessage(pID, -1, "3/3 Warnings, kicked"):
Kick(pID);
}
}
}
return true;
}