i want 1 big explosion with those TE_EXPLOSION. but am i using those wrong? it creates a huge cluster explosion with multiple explosions happening. this dmgtime does not look like a clean way. grenade_explosion() gave me the exact right moment, but no owner. can i store custom data on an entity somehow?
Code:
RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade", .Post = false)
...
public fw_ThinkGrenade(ent)
{
static Float:fDamageTime;
pev(ent, pev_dmgtime, fDamageTime);
if(fDamageTime <= get_gametime())
{
client_print(0, print_chat, "%0.3f% %0.3f% %0.3f%", fDamageTime, get_gametime(), fDamageTime-get_gametime())
GrenadeGoing2Explode(ent, pev(ent, pev_owner))
}
}
GrenadeGoing2Explode(const iGrenade, const thrower)
{
static Float:originF[3]
pev(iGrenade, pev_origin, originF)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_SMOKE);
write_coord(floatround(originF[0])); // Position
write_coord(floatround(originF[1]));
write_coord(floatround(originF[2]) + random_num(120, 200));
write_short(g_iSmokeSprite); // Sprite index
write_byte(random_num(100, 120)); // Scale
write_byte(random_num(10, 20)); // Framerate
message_end();
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_EXPLOSION )
write_coord( floatround( originF[0] ) )
write_coord( floatround( originF[1] ) )
write_coord( floatround( originF[2] ) )
write_short( explosion1 )
write_byte( 10 ) // was 50
write_byte( random_num(10, 20) ) // was 15
write_byte( 0 )
message_end()
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_EXPLOSION )
write_coord( floatround( originF[0] ) )
write_coord( floatround( originF[1] ) )
write_coord( floatround( originF[2] ) )
write_short( explosion2 )
write_byte( 10 )
write_byte( random_num(10, 20) )
write_byte( 0 )
message_end()
}
output
Code:
9.005 9.005 -0.000%
9.005 9.105 -0.100%
9.005 9.655 -0.650%
update:
so now im back to using grenade_explosion()but that itself fires like 20 times on explosion. so i guess thats why it creates 20 extra explosions... how to return after 1 execution? i want it to continue handling regular damage, i dont want to stop the event