SA-MP Forums Archive
Creating Invincible Crates - 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: Creating Invincible Crates (/showthread.php?tid=271211)



Creating Invincible Crates - iPLEOMAX - 23.07.2011

Hi guys, I was thinking if we could set an object as invincible, the ones that get destroyed on hit/explosion.

Is it possible?


Re: Creating Invincible Crates - CyNiC - 23.07.2011

Use IsPlayerInRangeOfPoint to checking the position of the the player to know if he's near of the object and check your animation if is a fight anim.
Or create pickups around the object to check if any player is near and create a temporary timer to check if he's yet is near, being that in this timer you check the position like in the my first suggestion.
In the two suggestions you have that destroy and create the object to make them visible after destroyed.


Re: Creating Invincible Crates - iPLEOMAX - 23.07.2011

Quote:
Originally Posted by CyNiC
Посмотреть сообщение
Use IsPlayerInRangeOfPoint to checking the position of the the player to know if he's near of the object and check your animation if is a fight anim.
Or create pickups around the object to check if any player is near and create a temporary timer to check if he's yet is near, being that in this timer you check the position like in the my first suggestion.
In the two suggestions you have that destroy and create the object to make them visible after destroyed.
I could do that, but There are 34 such objects (combined to make a nice thing).

So now i added a timer and loops etc to destroy/create per 8 seconds. I'm trying to find more ways to optimize it..