Trying to make anti health hack
#1

So im trying to make an anti health hack for my server and this is what I have so far:

Код:
new Float:pHealth[MAX_PLAYERS] // Variable to store the player's health
OnPlayerTakeDamage

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
    {
        if(GetPlayerTeam(issuerid) != GetPlayerTeam(playerid)) // If the players are not in the same team 
        {
        	GetPlayerHealth(playerid,pHealth[playerid]);
        	SetPlayerHealth(playerid,pHealth[playerid]-amount);
        }
    }
    if(issuerid == INVALID_PLAYER_ID) // If self-inflicted
    {
        GetPlayerHealth(playerid,pHealth[playerid]);
    	SetPlayerHealth(playerid,pHealth[playerid]-amount);
    }
    return 0;
}
OnPlayerSpawn

Код:
OnPlayerSpawn(playerid)
{
     	pHealth[playerid] = 100.0;
        return 1;
}
So could anyone tell me is this code good or I need to improve it? I don't need the anti-armour hack.

EDIT: I added the self inflicted damage.
Reply


Messages In This Thread
Trying to make anti health hack - by Remba031 - 28.03.2014, 22:01
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 22:10
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 22:21
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 22:45
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 22:55
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 23:03
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 23:29
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 23:34
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 23:40
Re: Trying to make anti health hack - by Pottus - 29.03.2014, 00:02

Forum Jump:


Users browsing this thread: 2 Guest(s)