30.11.2012, 11:31
(
Last edited by gtakillerIV; 03/12/2012 at 09:31 AM.
)
Hey guys, I made this ping limiter, but the problem is it doesn't get executed. What's wrong?
It didin't print "it got called 1" nor did it print "it got called 2", thanks for reading.
pawn Code:
public OnPlayerUpdate(playerid)
{
if(PingWarn[playerid] == 4)
{
print("it got called 1");
new kickedname[24], string[240];
GetPlayerName(playerid, kickedname, 24);
format(string, sizeof(string), ""red"%s "orange"Has been kicked from the Server "lime"| "orange"Reason: Reaching maximum ping warns "lime"("red"5/5"lime") |", kickedname);
SendClientMessageToAll(Yellow, string);
Kick(playerid);
}
else if(GetPlayerPing(playerid) > ServerInfo[Ping])
{
print("it got called 2");
PingWarn[playerid]++;
new string[240], name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), ""red"%s "orange"Has recived a Ping warning "lime"| Ping: "red"%i "lime"| "orange"Ping Limit: "red"%i "lime"| "orange"Warning "red"%i/5 "lime"|", name, GetPlayerPing(playerid), ServerInfo[Ping], PingWarn[playerid]);
SendClientMessageToAll(Yellow, string);
}