SA-MP Forums Archive
how to - health now SetPlayerhealth - 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: how to - health now SetPlayerhealth (/showthread.php?tid=460036)



how to - health now SetPlayerhealth - SwisherSweet - 26.08.2013

how do i minus a player's health now SetPlayerhealth?


Re: how to - health now SetPlayerhealth - dowster - 26.08.2013

You will want to get the player's health value by using GetPlayerHealth(playerid, health), subtract the returned value, and then pass that into SetPlayerHealth(playerid, health).

References:

https://sampwiki.blast.hk/wiki/GetPlayerHealth

https://sampwiki.blast.hk/wiki/SetPlayerHealth


Re: how to - health now SetPlayerhealth - Vanter - 26.08.2013

SetPlayerHealth(playerid, GetPlayerHealth(playerid)-10);
-10 -123132 012313y1328713y use any number


Re: how to - health now SetPlayerhealth - dowster - 26.08.2013

Quote:
Originally Posted by Vanter
Посмотреть сообщение
SetPlayerHealth(playerid, GetPlayerHealth(playerid)-10);
-10 -123132 012313y1328713y use any number
This method will not work due to GetPlayerHealth not actually returning other than fail/success boolean.

See: https://sampwiki.blast.hk/wiki/GetPlayerHealth