Raised This Month: $ Target: $400
 0% 

Distance To Bomb Planted v1.1


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-19-2016 , 07:14   Re: Distance To Bomb Planted v1.1
Reply With Quote #31

Finding entity by model is a poor way.
You could loop all grenade entities and check m_bIsC4 offset, then break the loop once you found it.
Or hook BombDrop event and use read_data to get CoordX, CoordY and CoordZ from the event. Just remember to use correct filters(4 th arg is 1 when planted and 0 when dropped), so register_event("BombDrop", "OnBombDrop", "a", "4=1").

Creating 32 task at 0.1 is not your best bet. Make only one at 1.0 seconds and loop players, or(as Arkshine told you) hook grenade think when bomb is planted(so on BombDrop event) and update the distance. Don't forget to remove the hook once it's no longer needed.

Unapproved until you make some changes.
__________________

Last edited by HamletEagle; 04-19-2016 at 07:14.
HamletEagle is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode