Raised This Month: $32 Target: $400
 8% 

How to mute 2 players for eachother by STEAM ID


Post New Thread Reply   
 
Thread Tools Display Modes
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-10-2017 , 17:23   Re: How to mute 2 players for eachother by STEAM ID
Reply With Quote #11

https://sm.alliedmods.net/api/index....d=show&id=945&

Code:
SetListenOverride(client1, client2, Listen_No);
SetListenOverride(client2, client1, Listen_No);
__________________
Neuro Toxin is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 07-10-2017 , 17:52   Re: How to mute 2 players for eachother by STEAM ID
Reply With Quote #12

Quote:
Originally Posted by Neuro Toxin View Post
https://sm.alliedmods.net/api/index....d=show&id=945&

Code:
SetListenOverride(client1, client2, Listen_No);
SetListenOverride(client2, client1, Listen_No);
And how do i properly get client1 and client2?
midnight9 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-10-2017 , 22:04   Re: How to mute 2 players for eachother by STEAM ID
Reply With Quote #13

So, just to reiterate, since I don't think anyone actually read what the original poster wants:

He has a plugin that already does the voice and chat muting. He said this in the original post. He posted the code, so you can see he has code that does that already. What he wants is to make the muting permanent.
Fyren is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 07-11-2017 , 01:28   Re: How to mute 2 players for eachother by STEAM ID
Reply With Quote #14

Quote:
Originally Posted by Fyren View Post
So, just to reiterate, since I don't think anyone actually read what the original poster wants:

He has a plugin that already does the voice and chat muting. He said this in the original post. He posted the code, so you can see he has code that does that already. What he wants is to make the muting permanent.
Yes exactly, the plugin allready handles the voice and chat mutes just fine. I just dont know how to pernamently mute 2 steam ids for each other using that plugin.
midnight9 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-11-2017 , 02:25   Re: How to mute 2 players for eachother by STEAM ID
Reply With Quote #15

Missed the point lol.

You would need to use a database.

https://wiki.alliedmods.net/SQL_(SourceMod_Scripting)

If you're not confident I would suggest going back to the request forum.
__________________
Neuro Toxin is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 07-11-2017 , 02:53   Re: How to mute 2 players for eachother by STEAM ID
Reply With Quote #16

Quote:
Originally Posted by midnight9 View Post
Yes exactly, the plugin allready handles the voice and chat mutes just fine. I just dont know how to pernamently mute 2 steam ids for each other using that plugin.
Try

Code:
char STEAM_ID1[] = "xxxxxxx";
char STEAM_ID2[] = "xxxxxxx"; 

public void OnClientPostAdminCheck(int client)
{
	if (IsFakeClient(client)) return;

	char id[64]; int client2;
	GetClientAuthId(client, AuthId_Steam2, id, sizeof(id));

	if (StrEqual(id, STEAM_ID1))
	{
		client2 = FindPlayer(STEAM_ID2);
	}
	else if (StrEqual(id, STEAM_ID2))
	{
		client2 = FindPlayer(STEAM_ID1);
	}

	if (client2)
	{
		SetListenOverride(client, client2, Listen_No);
		SetListenOverride(client2, client, Listen_No);
	}
}
		
stock int FindPlayer(const char[] thatMthFuckingSteamId)
{
	char id[64]; int player;

	for (int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i) && !IsFakeClient(i))
		{
			GetClientAuthId(i, AuthId_Steam2, id, sizeof(id));
			
			if (StrEqual(id, thatMthFuckingSteamId))
			{
				return player;
			}
		}
	}
	return -1;
}
Visual77 is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 07-12-2017 , 15:40   Re: How to mute 2 players for eachother by STEAM ID
Reply With Quote #17

Quote:
Originally Posted by Visual77 View Post
Try

Code:
char STEAM_ID1[] = "xxxxxxx";
char STEAM_ID2[] = "xxxxxxx"; 

public void OnClientPostAdminCheck(int client)
{
	if (IsFakeClient(client)) return;

	char id[64]; int client2;
	GetClientAuthId(client, AuthId_Steam2, id, sizeof(id));

	if (StrEqual(id, STEAM_ID1))
	{
		client2 = FindPlayer(STEAM_ID2);
	}
	else if (StrEqual(id, STEAM_ID2))
	{
		client2 = FindPlayer(STEAM_ID1);
	}

	if (client2)
	{
		SetListenOverride(client, client2, Listen_No);
		SetListenOverride(client2, client, Listen_No);
	}
}
		
stock int FindPlayer(const char[] thatMthFuckingSteamId)
{
	char id[64]; int player;

	for (int i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i) && !IsFakeClient(i))
		{
			GetClientAuthId(i, AuthId_Steam2, id, sizeof(id));
			
			if (StrEqual(id, thatMthFuckingSteamId))
			{
				return player;
			}
		}
	}
	return -1;
}

Unfortunately doesnt work
midnight9 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 06:55.


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