I did a small delay for grenade when it on the ground. it works well. but I want if it touches a player - explosion will be immediately
Code:
public pfn_touch(ptr, ptd)
{
if(pev_valid(ptr))
{
new classname[32];
pev(ptr, pev_classname, classname, 31);
if(equal(classname, nail_classname))
{
new Float:fOrigin[3]
new param[1]
param[0] = ptr
if(PointContents(fOrigin) == CONTENTS_SOLID) {
fOrigin[2] += 100.0
set_task(2.5, "task_ExplodeNade", 0, param, 1)
}
}
}
}
public task_ExplodeNade(param[]) if(is_valid_ent(param[0]))
{
new Float:fOrigin[3];
new iOrigin[3];
pev(param[0], pev_origin, fOrigin);
FVecIVec(fOrigin,iOrigin);
nail_radius_damage(param[0]);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(explode2);
write_byte(30);
write_byte(15);
write_byte(0); //flags
message_end();
engfunc(EngFunc_RemoveEntity, param[0]);
}
so how to know if grenade hit the player ???
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc