SA-MP Forums Archive
Fist damage broke? (rep) - 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: Fist damage broke? (rep) (/showthread.php?tid=588553)



Fist damage broke? (rep) - Matical - 09.09.2015

Well, i dont have any defines for my fists, but it does a random damage from 5-50, if you hit them with a two peice it will take like 50hp. i dont know what to do, ive tried making it so
Код:
	new Float:HP = GetPlayerHealth(playerid, HP);
	if(weaponid == 0)
	{
	    SetPlayerHealth(playerid, HP-3.0);
	}
but it just instantly kills them when i do that.


Re: Fist damage broke? (rep) - Vince - 09.09.2015

You're doing it all wrong. GetPlayerHealth in itself only returns 0 or 1 depending on whether the player is connected. So you will get -2 health which will of course kill the player instantly. Check the documentation on the wiki.