float: health problem - help! :D - 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: float: health problem - help! :D (
/showthread.php?tid=470363)
float: health problem - help! :D -
Chrillzen - 17.10.2013
Hey guys.

Here's my problem. I want to give + 20 hp whenever taking a hit of LSD. But it just sets my hp to 20 instead.
My code:
pawn Код:
new Float:PlayersHealth;
new Float:PlayersArmour;
if (PlayerInfo[playerid][dLSD] < 1) return SCM(playerid, COLOR_LIGHTRED, "[Error]: You do not have any LSD.");
SetPlayerHealth(playerid, PlayersHealth + 20.0);
SetPlayerArmour(playerid, PlayersArmour + 30.0);
PlayerActionMessage(playerid,15.0,"places a lsd hit on his tounge.");
SCM(playerid, -1, "** Uh.. watch out for dragons n' shit...");
Re: float: health problem - help! :D -
Misiur - 17.10.2013
You forgot to use GetPlayerHealth and GetPlayerArmour first.
Re: float: health problem - help! :D -
Chrillzen - 17.10.2013
Alright, I got it to work.