|
AMX Mod X Plugin Approver
|
05-22-2014
, 10:52
Re: Distance To Bomb Planted v1.1
|
#22
|
Creating task each 0.1 second, is really a bad idea.
What I would do is:
- Hooking grenade think when bomb is planted.
- Inside think, Making sure it's a C4 (m_bIsC4 grenade offset) and doing stuff.
- Remove hooking once exploded/defused/round end?
- I may lower the next think time (not the actual next think, just a cooldown for message), by default it will be 0.13, maybe changing to 0.5 or 1 sec should be enough.
Also what you're doing with float_to_str and loop is silly. Just use floatround(get_distance_f( directly in show_hudmessage.
Or better, you could cache the bomb origin from BombDrop event, then working with integer origin (so using get_user_origin, get_distance).
Well, basically there are rooms for improvements. So, try things.
__________________
Last edited by Arkshine; 05-23-2014 at 10:16.
|
|
|
|