Raised This Month: $183 Target: $400
 45% 

[Tutorial] [CS:GO] How to make a gun silent


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-07-2020 , 11:50   [Tutorial] [CS:GO] How to make a gun silent
Reply With Quote #1

Code:
AddTempEntHook("Shotgun Shot", Hook_FireBullets);


public Action:Hook_FireBullets(const String:te_name[], const Players[], numClients, Float:delay)
{
	new client = 0;
	
	for (new i = 1; i <= MaxClients;i++)
	{
		if(!IsClientInGame(i))
			continue;
			
		new bool:Found = false;
		
		for (new a = 0; a < numClients;a++)
		{
			if(Players[a] == i)
				Found = true;
		}
		
		if(!Found)
		{
			client = i;
			
			break;
		}
	}
	
	if(client == 0)
		return Plugin_Continue;
	
	new weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");

	if(weapon == -1)
		return Plugin_Continue;

	// client is the player that fired the weapon	
	// weapon is the weapon that was fired.
	return Plugin_Stop;
}
I have no clue why the temp ent is "Shotgun Shot" but it actually works.
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 15$

Last edited by eyal282; 12-07-2020 at 17:06.
eyal282 is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 12-08-2020 , 11:31   Re: [Tutorial] [CS:GO] How to make a gun silent
Reply With Quote #2

Quote:
Originally Posted by eyal282 View Post
I have no clue why the temp ent is "Shotgun Shot" but it actually works.

Thats how it worked for shotguns only some time ago. They moved all weapons fire sounds to this method and havn't renamed it.
__________________
zipcore is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-13-2020 , 08:17   Re: [Tutorial] [CS:GO] How to make a gun silent
Reply With Quote #3

Quote:
Originally Posted by zipcore View Post
Thats how it worked for shotguns only some time ago. They moved all weapons fire sounds to this method and havn't renamed it.
Very practical, sure I can live with that.
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 15$
eyal282 is offline
Reply


Thread Tools
Display Modes

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 01:12.


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