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



Health - CrazyChoco - 08.12.2012

Hello!

I've been re-searching a bit with giving an object health, but with no luck.
So I thought that some out here may know it? I just need it like, giving a object like 1000 health, then if player shoot on it it will decrease and when it reach 0 destroy object.

Does any know if it already is something similar to this?

-Thanks


Re: Health - Faisal_khan - 08.12.2012

It will be good if this was possible, am afraid that it is not possible atm.


Re: Health - Niko_boy - 08.12.2012

well it is possible some player done it making some scripts
may be this can be an illustration ?
https://sampforum.blast.hk/showthread.php?tid=380431

all u need to do is create the object and a variable like objHealth = 1000;
and get camera pos/vecotr if aiming at the object and is shooting then decrease the variable
and later check for stuff like if( objHealrh <= 0 ) destroy the object


Re: Health - CrazyChoco - 08.12.2012

https://sampforum.blast.hk/showthread.php?tid=330745

You know if here is something similar to this? Or any got an ideas?


Re: Health - CrazyChoco - 08.12.2012

Quote:
Originally Posted by Niko_boy
Посмотреть сообщение
well it is possible some player done it making some scripts
may be this can be an illustration ?
https://sampforum.blast.hk/showthread.php?tid=380431

all u need to do is create the object and a variable like objHealth = 1000;
and get camera pos/vecotr if aiming at the object and is shooting then decrease the variable
and later check for stuff like if( objHealrh <= 0 ) destroy the object
(Sorry for double post)

Isn't it possible to make a damage system?


Re: Health - Lz - 08.12.2012

Quote:
Originally Posted by CrazyChoco
Посмотреть сообщение
(Sorry for double post)

Isn't it possible to make a damage system?
I guess you could check if the player is in range of a point, Then if the left mouse button is clicked it would decrease the variable, When the variable = 0 it destroys the object.. But that would only be good for using a chainsaw to destroy it like with the lumberjack example you showed