Anti HP
#1

I set player's HP to 99 when they spawn and added this under OnPlayerUpdate
Код:
    new Float:Hp; GetPlayerHealth( playerid, Hp );
    if(IsSpawned[playerid] != 0 && Hp >= 100)
    {
	new string[128];
        format(string,sizeof(string),"%s(%d) is health hacking.",PlayerName(playerid),playerid);
	SendClientMessageToAll(1,string);
    }
but when the player spawn it says Example(0) is health hacking and then health become 99 and it says nothing and work how can i prevent that 100 HP that i got before SetPlayerHealth(playerid,99) or to prevent that detect before i get 99 HP ?
Reply
#2

PHP код:
public OnPlayerSpawn(playerid)
{
    
SetPlayerArmour(playerid99);
    
SetPlayerHealth(playerid99);
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    new 
Float:pHealth;
    
GetPlayerHealth(playeridpHealth);
    if(
pHealth 99)
    {
    
SendClientMessage(playerid, -1"{FF0000} You Got Banned for Health Hacking [ HP Exceeded 99 ]");
    
Ban(playerid);
    }
    new 
Float:pArmour;
    
GetPlayerArmour(playeridpArmour);
    if(
pArmour 99)
    {
    
SendClientMessage(playerid, -1"{FF0000} You Got Banned for Armour Hacking [ AP Exceeded 99 ]");
    
Ban(playerid);
    }
    return 
1;

You could use that credit @hoosa
Reply
#3

Maybe the problem was in HP >= 100 I changed it but same stuff
Код:
    new Float:Hp; GetPlayerHealth( playerid, Hp );
    if(IsSpawned[playerid] != 0 && Hp > 99)
    {
	new string[128];
        format(string,sizeof(string),"%s(%d) is health hacking.",PlayerName(playerid),playerid);
	SendClientMessageToAll(1,string);
    }
Reply
#4

Quote:
Originally Posted by zamaleksc
Посмотреть сообщение
Maybe the problem was in HP >= 100 I changed it but same stuff
Код:
    new Float:Hp; GetPlayerHealth( playerid, Hp );
    if(IsSpawned[playerid] != 0 && Hp > 99)
    {
	new string[128];
        format(string,sizeof(string),"%s(%d) is health hacking.",PlayerName(playerid),playerid);
	SendClientMessageToAll(1,string);
    }
>=100 is not the problem it means 100 and up
Reply
#5

Solved,just added some seconds and then the player IsSpawned[playerid] =1;
Reply
#6

dont forget ppl can drink from vending machines and get accidently banned so remove those objects
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)