Raised This Month: $ Target: $400
 0% 

[CSGO] Help in spawning a working "decoy_projectile" Entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaybeBullet
New Member
Join Date: Feb 2021
Old 02-21-2021 , 09:12   [CSGO] Help in spawning a working "decoy_projectile" Entity
Reply With Quote #1

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

Last edited by MaybeBullet; 02-21-2021 at 16:06. Reason: Restore to previous version.
MaybeBullet is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode