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

How to let everyone talk with each other.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nikita2150
Junior Member
Join Date: Feb 2018
Old 02-15-2018 , 13:20   How to let everyone talk with each other.
Reply With Quote #1

Hello everyone,
I've been searching on the internet on how to make everyone able to speak with each other in the chat, to let dead players talk with live players and live players with dead.
I would appreciate any help, thank you in advanced!
nikita2150 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-15-2018 , 13:39   Re: How to let everyone talk with each other.
Reply With Quote #2

Quote:
Originally Posted by nikita2150 View Post
Hello everyone,
I've been searching on the internet on how to make everyone able to speak with each other in the chat, to let dead players talk with live players and live players with dead.
I would appreciate any help, thank you in advanced!
Game?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
nikita2150
Junior Member
Join Date: Feb 2018
Old 02-15-2018 , 13:43   Re: How to let everyone talk with each other.
Reply With Quote #3

Quote:
Originally Posted by eyal282 View Post
Game?
CS:S
nikita2150 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 02-15-2018 , 15:05   Re: How to let everyone talk with each other.
Reply With Quote #4

For css maybe sv_alltalk 1
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-16-2018 , 08:08   Re: How to let everyone talk with each other.
Reply With Quote #5

Maybe set sm_deadtalk to 2?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
nikita2150
Junior Member
Join Date: Feb 2018
Old 02-17-2018 , 03:48   Re: How to let everyone talk with each other.
Reply With Quote #6

Okay, I see no one understood me, I'll ask another question.
How to let a *DEAD* admin talk in the cheat with live and dead players.
Thank you in advance.
nikita2150 is offline
kot4404
Senior Member
Join Date: Mar 2013
Old 02-17-2018 , 06:49   Re: How to let everyone talk with each other.
Reply With Quote #7

Use sm_say command
kot4404 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 02-21-2018 , 05:48   Re: How to let everyone talk with each other.
Reply With Quote #8

Quote:
Originally Posted by nikita2150 View Post
Okay, I see no one understood me, I'll ask another question.
How to let a *DEAD* admin talk in the cheat with live and dead players.
Thank you in advance.
I made an API plugin called ”Chat Revamp”. It’s yet to be able to allow chats that shouldn’t be sent to be sent but I’ll fix it today and post you another plugin that allows dead chat.

Tell me if this works after you adjust the cvars.


Code:
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo = 
{
	name = "Chat Revamp ( Chat Processor )",
	author = "Eyal282 ( FuckTheSchool )",
	description = "Allows plugins to intercept chat communications between players and edit them",
	version = "1.3",
	url = "<- URL ->"
}

new Handle:fw_ChatSent = INVALID_HANDLE;
new Handle:fw_ChatSent_Post = INVALID_HANDLE;

new Handle:cvHideNameChange = INVALID_HANDLE;
new Handle:cvDeadChat = INVALID_HANDLE;


public Action:CR_OnChatSent(&Receiver, &Sender, &bChat, String:Tag[], String:Name[], String:Message[], &WillSend)
{
	if(WillSend)
	{
		if(GetConVarBool(cvHideNameChange))
		{	
			if(StrContains(Tag, "Name", false) != -1 && CheckCommandAccess(Sender, "sm_kick", ADMFLAG_KICK))
			{
				if(!CheckCommandAccess(Receiver, "sm_kick", ADMFLAG_KICK))
					return Plugin_Handled;
			}
		}
	}
	else
	{
		if(GetConVarBool(cvDeadChat))
		{
			if(StrContains(Tag, "Dead", false) != -1)
			{
				if(StrContains(Tag, "All") != -1 || GetClientTeam(Sender) == GetClientTeam(Receiver))
					WillSend = true;
			}
		}
	}
	return Plugin_Continue;
}

public Action:CR_OnChatSent_Post(Receiver, Sender, bChat, String:Tag[], String:Name[], String:Message[])
{
	if(!GetConVarBool(cvHideNameChange))
		return Plugin_Continue;
		
	else if(StrContains(Tag, "Name", false) != -1 && CheckCommandAccess(Sender, "sm_kick", ADMFLAG_KICK))
		PrintToChat(Sender, "Your name change is only shown to admins!");
	
	return Plugin_Continue;
}
public OnPluginStart()
{	
	HookUserMessage(GetUserMessageId("SayText2"), Message_SayText2, true);
	
	// public Action:CR_OnChatSent(&Sender, &bChat, String:Tag[], String:Name[], String:Message[], &Something, &OtherSomething, players[], &playersNum)
	
	// @param Receiver			The client receiving the message.
	// @param Sender			The client sending the message.
	// @param bChat				Unsure, I think whether or not the message is printed in console not only in chat.
	// @param String:Tag[]		Message display tags ( Changing will not affect who will see it, but it acts as a format of message, Example: #L4D_Chat_All, #L4D_Chat_Infected )
	// @param String:Name[]		Name of the sender.
	// @param String:Message[]	The message the client sends.
	// @param WillSend			Will the message actually be sent without changing this to true? Change to true if you want to force the message to be sent even if it shouldn't.

	// @Return					Even to allow chat to send, Odd to disallow chat to send. Plugin_Stop will act as Plugin_Continue due to that.
	
	// @Note					Tag in L4D2 and probably all games will contain "Name" when the chat message is a name change.

	// @Note					All parameters are copied back to the forward.
	fw_ChatSent = CreateGlobalForward("CR_OnChatSent", ET_Event, Param_CellByRef, Param_CellByRef, Param_String, Param_String, Param_String, Param_CellByRef, Param_CellByRef, Param_Array, Param_CellByRef, Param_CellByRef);
	
	// public Action:CR_OnChatSent_Post(Receiver, Sender, bChat, String:Tag[], String:Name[], String:Message[])
	
	// @Note: The parameters on post and pre are identical.
	// @Note: Tag in L4D2 and probably all games will contain "Name" when the chat message is a name change.
	fw_ChatSent_Post = CreateGlobalForward("CR_OnChatSent_Post", ET_Ignore, Param_Cell, Param_Cell, Param_String, Param_String, Param_String, Param_Cell, Param_Cell, Param_Array, Param_Cell);
	
	
	cvHideNameChange = CreateConVar("cr_hide_admin_name_change", "1", "If set to 1, only admins can see name changes");
	cvDeadChat = CreateConVar("cr_dead_chat", "0", "If set to 1, dead players can chat.");
}

public Action:Message_SayText2(UserMsg msg_id, Handle:Bf, const int[] players, int playersNum, bool reliable, bool init)
{
	new Sender = BfReadByte(Bf);
	
	if(Sender <= 0 || Sender > MaxClients)
		return Plugin_Continue;
		
	new bChat = BfReadByte(Bf);
	
	new String:Tag[50];
	BfReadString(Bf, Tag, sizeof(Tag));
	
	new String:Name[64];
	BfReadString(Bf, Name, sizeof(Name));
	
	new String:Message[300];
	BfReadString(Bf, Message, sizeof(Message));

	new Handle:DP = CreateDataPack();
		
	RequestFrame(SendMessage, DP);
	
	WritePackCell(DP, Sender);
	WritePackCell(DP, bChat);
	WritePackString(DP, Tag);
	WritePackString(DP, Name);
	WritePackString(DP, Message);
	
	WritePackCell(DP, playersNum);
	
	for(new i=0;i < playersNum;i++)
		WritePackCell(DP, players[i]);
		
	return Plugin_Handled;
}

public SendMessage(Handle:DP)
{
	ResetPack(DP);
	new Sender = ReadPackCell(DP);
	new bChat = ReadPackCell(DP);
	new String:Tag[50];
	ReadPackString(DP, Tag, sizeof(Tag));
	new String:Name[64];
	ReadPackString(DP, Name, sizeof(Name));
	new String:Message[300];
	ReadPackString(DP, Message, sizeof(Message));
	new players[MAXPLAYERS];
	new playersNum = ReadPackCell(DP);

	for(new i=0;i < playersNum;i++)
	{
		players[i] = ReadPackCell(DP);
	}
	
	CloseHandle(DP);

	new ReturnValue;
	
	for(new id=1;id <= MaxClients;id++)
	{
		if(!IsClientInGame(id))
			continue;
			
		else if(IsFakeClient(id))
			continue;
			
		new bool:WillSend;
		for(new i=0;i < playersNum;i++)
		{
			if(players[i] == id)
			{
				WillSend = true;
			}
		}
		Call_StartForward(fw_ChatSent);
		
		Call_PushCellRef(id);
		Call_PushCellRef(Sender);
		Call_PushCellRef(bChat);
		Call_PushStringEx(Tag, sizeof(Tag), SM_PARAM_STRING_UTF8|SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
		Call_PushStringEx(Name, sizeof(Name), SM_PARAM_STRING_UTF8|SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);	
		Call_PushStringEx(Message, sizeof(Message), SM_PARAM_STRING_UTF8|SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);	
		Call_PushCellRef(WillSend);
			
		Call_Finish(ReturnValue);
			
		if((ReturnValue & 1) == 1 || !WillSend)
				return;
				
		static UserMsg:SayText;
		if(!SayText)
			SayText = GetUserMessageId("SayText2");
		
		new Handle:Bf = StartMessageOne("SayText2", id, USERMSG_BLOCKHOOKS);
		BfWriteByte(Bf, Sender);
		BfWriteByte(Bf, bChat);
		BfWriteString(Bf, Tag);
		BfWriteString(Bf, Name);
		BfWriteString(Bf, Message); 
		EndMessage()
	
		Call_StartForward(fw_ChatSent_Post);
		
		Call_PushCell(id);
		Call_PushCell(Sender);
		Call_PushCell(bChat);
		Call_PushString(Tag);
		Call_PushString(Name);	
		Call_PushString(Message);	
		
		Call_Finish(ReturnValue);
	}
}
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 02-21-2018 at 11:57.
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 04:44.


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