OnPlayerGiveDamage bugged?
#1

Hi,

I use this code:

Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    if(damagedid != INVALID_PLAYER_ID)
    {
    	        new Float:Health,Float:Armour;
	   	GetPlayerHealth(damagedid,Health);
	   	GetPlayerArmour(damagedid,Armour);
	   	if(Armour > 0)
	        {
       		switch(weaponid)
       		{
       		    case 24: return SetPlayerArmour(damagedid,Armour-20);
				default: return 1;
	        }
                }
    }
    return 1;
}
When I shoot on a player, he should forfeit 46(gta domage) +20 = 66hp but sometime he lost 66hp sometime 20hp and sometime he's ban for armor cheat with 249 hp.

This function it is not very precise?
Reply


Messages In This Thread
OnPlayerGiveDamage bugged? - by ombre - 27.05.2012, 01:17
Re: OnPlayerGiveDamage bugged? - by admantis - 27.05.2012, 02:05
Re: OnPlayerGiveDamage bugged? - by Face9000 - 27.05.2012, 06:18
Re : OnPlayerGiveDamage bugged? - by ombre - 27.05.2012, 16:14
Re : OnPlayerGiveDamage bugged? - by ombre - 27.05.2012, 16:54

Forum Jump:


Users browsing this thread: 1 Guest(s)