SA-MP Forums Archive
Reduce Life - 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: Reduce Life (/showthread.php?tid=81377)



Reduce Life - shark - 10.06.2009

Hello,

I'm stuck right now. I'm doing one cmd, that 'beat' the player and reduce 10 of his life.

Ex: James (ID 1) has 80 life and Bob (ID 2) type /beat 1, so the life of James will be reduce for 70.

But, just have GetPlayerHealth and SetPlayerHealth, and none of their are useful for me.
So, how do can I do this?

I just want the 'SetPlayerHealth(plid, ...........), know what I mean?


Re: Reduce Life - DarkClone - 10.06.2009

You mean this? SetPlayerHealth(playerid, 70);


Re: Reduce Life - shark - 10.06.2009

Not exactly.

Because, if 'Bob' type it again, the life of James will be stuck in 70 and will not reduce to 60.. you know?


Re: Reduce Life - NeRoSiS - 10.06.2009

Simple
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerhealth(playerid, health -10);


Re: Reduce Life - TheUllas - 10.06.2009

oh crap. I just wanted to post this. And now:
Warning - while you were typing a new reply has been posted. You may wish to review your post.
Crap XD


Re: Reduce Life - shark - 10.06.2009

Oh, that's exactly what I meant.

Thank you so much, it's work


Re: Reduce Life - NeRoSiS - 10.06.2009

No problem, have fun scripting