SA-MP Forums Archive
Adding pickup/object to players head ?! :/ - 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: Adding pickup/object to players head ?! :/ (/showthread.php?tid=171332)



Help please ! :) - Matej_ - 26.08.2010

Hey guys,
does anybody knows how to add health pickup to players head for about 1-2 seconds when he loses
a little health or armour like in this video:


[ame]http://www.youtube.com/watch?v=D5o5ziF2ehQ[/ame]




Re: Adding pickup/object to players head ?! :/ - Matej_ - 26.08.2010

Anyone ?


Re: Adding pickup/object to players head ?! :/ - LifeStyle - 26.08.2010

Wow, this is some nice stuff., I would like to know this also


Re: Adding pickup/object to players head ?! :/ - Mauzen - 26.08.2010

First of all you have to check if health or armor goes down, either with a timer or in OnPlayerUpdate. Get the health, compare it to a global variable and then store it into that variable, so you have the last health of the player.

If it decreases, create a object (https://sampwiki.blast.hk/wiki/CreateObject), the health or armor thing, check the object id list in wiki.
To get it over the player, use AttachObjectToPlayer (https://sampwiki.blast.hk/wiki/AttachObjectToPlayer) with offsetz=2 or 3