how to - health now SetPlayerhealth
#1

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

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
Reply
#3

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)