i did some tests on this and ended up with having this
PHP Code:
#include <amxmodx>
#include <csx>
#include <engine>
#include <fakemeta>
public plugin_init()
{
register_touch("*", "grenade", "fw_GrenadeTouch")
}
public grenade_throw(id, iEnt, wId)
{
if(wId != CSW_HEGRENADE)
{
return;
}
new Float:flNewVelocity[3]
velocity_by_aim(id, 500, flNewVelocity)
entity_set_vector(iEnt, EV_VEC_velocity, flNewVelocity)
//entity_set_float(iEnt, EV_FL_gravity, 0.0)
entity_set_int(iEnt, EV_INT_movetype, MOVETYPE_FLY)
// Working but not as it should be ..
//new Float:flVelocity[3]
//entity_get_vector(iEnt, EV_VEC_velocity, flVelocity)
//flVelocity[2] = 0.0
//entity_set_vector(iEnt, EV_VEC_velocity, flVelocity)
entity_set_float(iEnt, EV_FL_dmgtime, 9999.0)
set_rendering(iEnt, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16)
}
public fw_GrenadeTouch(iTouchedEnt, iGrenade)
{
if(!IsGrenade(iGrenade))
{
return;
}
if( entity_get_int(iTouchedEnt, EV_INT_solid) == SOLID_TRIGGER )
{
return;
}
set_rendering(iGrenade)
entity_set_float(iGrenade, EV_FL_dmgtime, 1.0)
}
IsGrenade( iEnt ) // VEN
{
if (get_pdata_int(iEnt, 114) & (1<<0))
{
return 1
}
return 0
}
__________________