http://amxmodx.org/api/engine/find_sphere_class
Better to use the new documentation, more convenient
1. Oprheu it's not hard, the hard part is searching for functions in windows dll( they don't have names so you need to search by used strings ), finding what function do what you want, but you get used with it after some time.
This is the signature:
Code:
{
"name" : "SG_Detonate",
"class" : "CGrenade",
"library" : "mod",
"identifiers" :
[
{
"os" : "windows",
"mod" : "cstrike",
"value" : "?SG_Detonate@CGrenade@@QAEXXZ"
},
{
"os" : "linux",
"mod" : "cstrike",
"value" : "SG_Detonate__8CGrenade"
},
{
"os" : "linux",
"mod" : "cstrike",
"value" : "_ZN8CGrenade11SG_DetonateEv"
}
]
}
Taken from one of Arkshine's posts, I think he won't have a problem with that.
The code:
PHP Code:
#include <amxmodx>
#include <orpheu>
public plugin_init()
{
new OrpheuFunction:HandleSGDetonateFunc
HandleSGDetonateFunc = OrpheuGetFunction("SG_Detonate", "CGrenade")
OrpheuRegisterHook(HandleSGDetonateFunc, "OnSGDetonate", OrpheuHookPre)
}
public OnSGDetonate(const GrenadeEntity)
{
}
I think you can go on your own further.
3. You choose your radius as you want.
PHP Code:
new ArrayPlayers[ 32 ], PlayersNum, id
const DMG_GRENADE = 1<<24
PlayersNum= find_sphere_class(here_you_put_your_new_nade_entity_index, "player", radius, ArrayPlayers, sizeof ArrayPlayers)
for(new i; i< PlayersNum; i++)
{
id = ArrayPlayers[i]
if(is_user_alive(id))
{
ExecuteHam(Ham_TakeDamage, id, 0, here_you_put_your_new_nade_entity_index, here_you_put_the_damage, DMG_GRENADE)
}
}
__________________