• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Chat Global

Status
Not open for further replies.

slp13at420

Mad Scientist
what script?

Eluna/lua scripts go into the ` /lua_scripts/` folder in your server folder.

do you already have one ?

you can use an existing World Chat and change the event id to 22 then add a check for the channel id to see if its the proper id then continue to the rest of the script.if you need some with editing the script just ask n I or a nother can help. just post the world chat you wish to use .

Player Event 22 will trigger for any channel chat. you will have to check if its the channel you need for your world chat . I did one a long while back and I'm assuming its here somewhere..
 
Last edited:

Lstm

Respected Member
I just added it

Code:
PLAYER_EVENT_ON_CHANNEL_CHAT            =     22,       // (event, player, msg, Type, lang, channel) - Can return false or new msg

:RpS_bored: :RpS_bored: :RpS_bored:
 

slp13at420

Mad Scientist
erm lol not that, I need to see your chat.lua file
or
did you just make a file and just add that line of wiki info?
 
Last edited:

slp13at420

Mad Scientist
I'm cooking up something for you ;)

Code:
[COLOR="#808080"]
-- by slp13at420 of EmuDevs.com
-- simple world chat WITHOUT the '#chat' command...WTF you say?
-- just change to /1 channel  . the channel can be changed below.
-- and chat away.
-- names are clickable for whispers and sub menu.
-- request by Lstm 4/27/2016.

local channel_name = "World Chat";
local channel_id = 1;
local duration = 5; -- in seconds.
local WorldChannelChat = {};

local Colors =  { -- colors for names and misc
	[0] = "|cff3399FF", -- blue for alliance name
	[1] = "|cffFF0000", -- red for horde name
	[3] = "|cff000000", -- black for [channel name]
	[4] = "|cff00cc00", -- green for "message"
	[5] = "|cff3399ff", -- good responce
	[6] = "|cffFF0000", -- bad responce
		};
	
local function ChatSystem(event, player, msg, Type, lang, channel)

local id = player:GetGUIDLow();

	if not(WorldChannelChat[id])then
	
		WorldChannelChat[id] = {
						time = GetGameTime()-duration,
						last_message = "",
		};
	end

	if(channel == channel_id)then
	
		if(lang ~= -1)then
		
			if(msg ~= "")then
				
				if(msg ~= "Away")then
					
					local time = GetGameTime();
					
					if(msg ~= WorldChannelChat[id].last_message)then
					
						if((time-WorldChannelChat[id].time >= duration))then
						
							local t = table.concat{"[", Colors[3], channel_name, "|r]", "[", Colors[player:GetTeam()],"|Hplayer:", player:GetName(),  "|h", player:GetName(), "|h", "|r]:", Colors[4], msg, "|r"};
							SendWorldMessage(t);
							WorldChannelChat[id].time = time;
							WorldChannelChat[id].last_message = msg;
						else
						    player:SendBroadcastMessage(Colors[6].."World chat spam timer triggered.|r")
						end				
					else
					 	player:SendBroadcastMessage(Colors[6].."World chat spam detected.|r")
					end				
				end
			end
		end
	
		return false;
	end
end
	
RegisterPlayerEvent(22, ChatSystem)

print("Grumbo'z World Chat Channel loaded.")
[/COLOR]

This will use `/1` channel as a dedicated World Chat Channel.

>> Repo <<
 
Last edited:
Status
Not open for further replies.
Top