SA-MP Forums Archive
Anti HP - 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: Anti HP (/showthread.php?tid=596376)



Anti HP - zamaleksc - 16.12.2015

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 ?


Re: Anti HP - malackov - 16.12.2015

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


Re: Anti HP - zamaleksc - 16.12.2015

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);
    }



Re: Anti HP - UltraScripter - 16.12.2015

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


Re: Anti HP - zamaleksc - 17.12.2015

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


Re: Anti HP - jamesbond007 - 17.12.2015

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