27.05.2012, 01:17
Hi,
I use this code:
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?
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; }
This function it is not very precise?