Help health anticheat not ban
#1

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!?
Reply
#2

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?
Reply
#3

Because you are using a localhost, the ban function does not ban your local ip (127.0.0.1)
Reply
#4

Код:
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;
}
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)