17.02.2014, 02:03
Just to tidy up your code:
pawn Код:
public CheckPing(playerid)
{
if(pInfo[playerid][pAdmin] > 0) return 0;
if(GetPlayerPing(playerid) <= MaxPing) return 0;
new string[90];
PingWarnings[playerid] += 1;
if(PingWarnings[playerid] >= 3)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s(%d) has been kicked due to reaching 3/3 ping warnings.", name, playerid);
SCMToALL(COLOR_GREY, string);
format(string, sizeof(string), "You have been kicked due to reaching the maximum amount of ping warnings (3/3)");
SCM(playerid, COLOR_RED, string);
SetTimerEx("KickPlayerEx", 1000, false, "i", playerid);
return 1;
}
format(string, sizeof(string), "You have received a ping warning (%d/3)", PingWarnings[playerid]);
SCM(playerid, COLOR_GREY, string);
return 1;
}