Raised This Month: $51 Target: $400
 12% 

Stop fists from making players drop guns?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xm3kilo
Member
Join Date: Jan 2018
Old 12-15-2018 , 09:40   Stop fists from making players drop guns?
Reply With Quote #1

Title.. Mainly since it affects the same team..
xm3kilo is offline
Agent Wesker
Senior Member
Join Date: Apr 2012
Old 12-15-2018 , 16:51   Re: Stop fists from making players drop guns?
Reply With Quote #2

Here's my fix

Code:
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
	
	//Client is not valid
	if (!IsValidClient(client) || !IsPlayerAlive(client))
	{
		return Plugin_Continue;
	}
	
	//Attempting to use right click
	if (buttons & IN_ATTACK2)
	{
		char buffer[128];
		
		int item = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");

		if (!IsValidEntity(item))
			return Plugin_Continue;

		GetEntityClassname(item, buffer, sizeof(buffer));
		
		if (StrEqual(buffer, "weapon_fists", false))
		{
			buttons &= ~IN_ATTACK2;
			return Plugin_Changed;
		}		
	}
	
	return Plugin_Continue;
}
If players use attack1 (left click) it will view punch same team members even if you block all damage.

Last edited by Agent Wesker; 12-15-2018 at 16:53.
Agent Wesker 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:42.


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