PingKick Help
#1

I made a PingKick script but its not working right

I Puted On Top Of Script
pawn Код:
forward PingKick(playerid);
OnGameModeInit()
pawn Код:
SetTimer("PingKick",1000,1);
pawn Код:
public PingKick(playerid)
{
new s[128], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
{
new Ping = GetPlayerPing(playerid);
if(Ping < 100)
{
format(s, sizeof(s), "%s has been kicked for high ping", Name);
SendClientMessageToAll(ADMIN_RED, s);
Kick(playerid);
}
}
return 1;
}

Everytime i connect i get kicked
Reply
#2

Код:
public PingKick(playerid)
{
new s[128], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
if(GetPlayerPing(playerid) < 100)
{
format(s, sizeof(s), "%s has been kicked for high ping", Name);
SendClientMessageToAll(ADMIN_RED, s);
Kick(playerid);
}
return 1;
}
Reply
#3

Tahnks and i just wanted to ask , do i need a timer for this?
Reply
#4

Yes you'll need a timer
but
is a ping lower than 100 not to low,,?
if you're pc isnt that good or even if its good it will be above 100 even if its one second and than you get kicked lol? maybe take 1000
Reply
#5

Quote:
Originally Posted by Krys^
Tahnks and i just wanted to ask , do i need a timer for this?
Of course, how else would you check? :P

You can also do with OnPlayerUpdate or check when player die, connect, spawn, ..
Reply
#6

But a timer is better
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)