Is it possible to hook the grenade explode event?
I had an idea that requires it. :twisted:
|
Re: Is it possible to hook the grenade explode event?
Include:
#include <hamsandwich> In plugin_init(): RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade") Somewhere else: public fw_ThinkGrenade(entity) { // [...] } Taken from: http://forums.alliedmods.net/showthread.php?t=74905 Found in 10 Seconds with the Forums' search function. D; Note that the above is not the whole secret. Conduct your own research on the plugin linked to above. ;) |
Re: Is it possible to hook the grenade explode event?
And that is the explosion? Like, if i client_print(hihi) will it print exactly at the explosion?
I did search, and i swear, i found nothing useful. I searched keywords "hooking grenade explosion" because i knew there was a dumb limit to the search thing. |
Re: Is it possible to hook the grenade explode event?
Test it.
|
Re: Is it possible to hook the grenade explode event?
You may want to verify/test if that also hooks C4 explosion. IIRC, they have the same classname. I could be wrong but it cant hurt to test.
|
Re: Is it possible to hook the grenade explode event?
1 Attachment(s)
Is it the code or is my hlds hating me for using it again?
|
Re: Is it possible to hook the grenade explode event?
1. You can't use get_user_origin() with a non-player entity.
2. Cache get_maxplayers() in a global variable and retrieve the value on plugin_init(). 3. Player indexes are from 1->maxplayers, not 0->(maxplayers - 1). 4. No need to check is_user_connected() since is_user_alive() checks if player is connected. 5. Don't create variables inside loops. 6. Cache the radius at the top of the function so you don't retrieve it for every player. |
Re: Is it possible to hook the grenade explode event?
Quote:
|
Re: Is it possible to hook the grenade explode event?
Code:
|
Re: Is it possible to hook the grenade explode event?
That method uses a Float, wrecked.
Float: origin[ 3 ] |
All times are GMT -4. The time now is 20:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.