PingKick Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PingKick Help (
/showthread.php?tid=110130)
PingKick Help -
MB@ - 24.11.2009
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
Re: PingKick Help -
RyDeR` - 24.11.2009
Код:
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;
}
Re: PingKick Help -
MB@ - 24.11.2009
Tahnks and i just wanted to ask , do i need a timer for this?
Re: PingKick Help -
Pawno_Master - 24.11.2009
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
Re: PingKick Help -
RyDeR` - 24.11.2009
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, ..
Re: PingKick Help -
Pawno_Master - 24.11.2009
But a timer is better