Help health anticheat not ban - 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)
+--- Thread: Help health anticheat not ban (
/showthread.php?tid=578466)
Help health anticheat not ban -
UltraScripter - 19.06.2015
pawn Код:
public OnGameModeInit()
{
SetTimer("USACHealthCheckBan", 500, true);
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, 99);
return 1;
}
pawn Код:
forward USACHealthCheckBan(playerid);
public USACHealthCheckBan(playerid)
{
new Float:USACPlayerHealth;
GetPlayerHealth(playerid, USACPlayerHealth);
if(USACPlayerHealth >= 100)
{
Ban(playerid);
}
return 1;
}
it only kick me But not ban why!?
Re: Help health anticheat not ban -
kalanerik99 - 19.06.2015
Change this
Код:
delete this ----- SetTimer("USACHealthCheckBan", 500, true);
to this(put it under on player update)
Код:
USACHealthCheckBan(palyerid);
And to explain you why it doesn't ban you:
Ban(
playerid);
Where do you think that it will found out what playerid
?
Re: Help health anticheat not ban -
Evocator - 19.06.2015
Because you are using a localhost, the ban function does not ban your local ip (127.0.0.1)
Re: Help health anticheat not ban -
X337 - 20.06.2015
Код:
SetTimer("USACHealthCheckBan", 500, true);
There's no parameter on USACHealthCheckBan function.
Replace your USACHealthCheckBan() function with this, hope it worked.
Код:
forward USACHealthCheckBan();
public USACHealthCheckBan()
{
new Float:USACPlayerHealth;
for(new i = 0; i <= GetPlayerPoolSize(); i++)
{
GetPlayerHealth(i, USACPlayerHealth);
if(USACPlayerHealth >= 100)
{
Ban(i);
}
}
return 1;
}
Re: Help health anticheat not ban -
UltraScripter - 20.06.2015
Quote:
Originally Posted by bondowocopz
Код:
SetTimer("USACHealthCheckBan", 500, true);
There's no parameter on USACHealthCheckBan function.
Replace your USACHealthCheckBan() function with this, hope it worked.
Код:
forward USACHealthCheckBan();
public USACHealthCheckBan()
{
new Float:USACPlayerHealth;
for(new i = 0; i <= GetPlayerPoolSize(); i++)
{
GetPlayerHealth(i, USACPlayerHealth);
if(USACPlayerHealth >= 100)
{
Ban(i);
}
}
return 1;
}
|
not work