Reduce Life
#1

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?
Reply
#2

You mean this? SetPlayerHealth(playerid, 70);
Reply
#3

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?
Reply
#4

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

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

Oh, that's exactly what I meant.

Thank you so much, it's work
Reply
#7

No problem, have fun scripting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)