Hi,
I'm trying to spawn a decoy grenade on my position and act like as if I've thrown it. Here is my code so far
Code:
RegConsoleCmd("sm_nade", nadespawn);
Action nadespawn (int client, int args)
{
float position[3];
GetClientAbsOrigin(client, position);
int e_nade = CreateEntityByName("decoy_projectile");
TeleportEntity(e_nade, position, NULL_VECTOR, NULL_VECTOR);
DispatchSpawn(e_nade);
SetEntProp(e_nade, Prop_Send, "m_iTeamNum", GetClientTeam(client));
SetEntProp(e_nade, Prop_Send, "m_hOwnerEntity", client);
SetEntProp(e_nade, Prop_Send, "m_hThrower", client);
AcceptEntityInput(e_nade, "InitializeSpawnFromWorld");
return Plugin_Handled;
}
The grenade spawns and emits smoke like it's supposed to but it does not make any weapon sound or gets exploded ever. Resulting it to stay endlessly without making any sound or whatsoever.
Anyone knows how to make it emit sound/ do the explosion?
Any help will be appreciated. Thanks