//The function below is called every 250ms
public HealthCheck()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerState(i) != PLAYER_STATE_SPECTATING && GetPlayerState(i) != PLAYER_STATE_WASTED)
{
new Float:health;
GetPlayerHealth(i, health);
if(health >= 100.0)
{
SetPlayerHealth(i, 75.0);
GetPlayerHealth(i, health);
if(health > 75.0)
{
SendClientMessage(i, COLOR_RED, "-> Cheater");
}
else
{
SendClientMessage(i, COLOR_RED, "-> Clean");
SetPlayerHealth(i, 100.0);
}
}
}
}
|
Originally Posted by viKKmaN
You didn't get my point... It works exactly as it shouldn't.
EXAMPLE: Retrieve Health: 100.0 Health Set: 75.0 Retrieve Health: 100.0 // Here is my problem. Second time it retrieves 100.0 health even if i have 75.0 health Retrieved Health != Health Set -> Cheater |
//The function below is called every 250ms
public HealthCheck()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerState(i) != PLAYER_STATE_SPECTATING && GetPlayerState(i) != PLAYER_STATE_WASTED)
{
new Float:health;
GetPlayerHealth(i, health);
if(health >= 100.0)
{
SetPlayerHealth(i, 75.0);
GetPlayerHealth(i, health);
if(health > 75.0)
{
SendClientMessage(i, COLOR_RED, "-> Cheater");
}
else
{
SendClientMessage(i, COLOR_RED, "-> Clean");
SetPlayerHealth(i, 100.0);
}
}
}
}
}
|
Originally Posted by cessil
SetPlayerHealth takes a couple of seconds to work, I came across this problem with my Anti Cheat too.
|