About SetPlayerHeath - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: About SetPlayerHeath (
/showthread.php?tid=189272)
About SetPlayerHeath -
zack3021 - 11.11.2010
Can someone remind me the code to give a player "+" health and not just set it.
Like SetPlayerHealth(playerid,20+); something like that but it is not not that.
Can you remind me of the correct code.
Re: About SetPlayerHeath -
SuperS82 - 11.11.2010
You must create a new float variable to store the players health you want to edit like this:
Код:
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health + 20.0);
Re: About SetPlayerHeath -
willsuckformoney - 11.11.2010
pawn Код:
new Float:Health;
GetPlayerHealth(playerid,Health);
SetPlayerHealth(playerid,Health+20); //Set 20 to what else you want if you don't want 20.
//For Taking health...
new Float:Health;
GetPlayerHealth(playerid,Health);
SetPlayerHealth(playerid,Health-20); //Set to to what else you want if you don't want 20.
Re: About SetPlayerHeath -
zack3021 - 11.11.2010
Thanks, it was that simple,
i did not remember. Thanks