first:
[pawn]new warn[MAX_PLAYERS] = 0;[/pawn]
OnPlayerDisconnect:
[pawn]warn[playerid] = 0;[/pawn]
OnPlayerCommandText:
[pawn] if (strcmp(cmd, "warn", true) == 0){
if (IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);
newvar = FindPlayerIDFromString(tmp);
if (!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /c warn <name/id>");
} else {
if (newvar != INACTIVE_PLAYER_ID) {
GameTextForPlayer(newvar,"~y~Admin warned you!");
format(szMsg,sizeof(szMsg),"Admin [ %s ] warned [%i] %s!",gPlayers[playerid],newvar,gPlayers[newvar]);
SendClientMessageToAll(COLOR_GREEN, szMsg);
warn[newvar]++;
if (warn[newvar] >= 3) {
Kick(newvar);
warn[newvar] = 0;
}
}
}
} else {
SendClientMessage(playerid, COLOR_GREEN, " You have not access to use the command!");
}
return 1;[/pawn]
hope you like