Avidgamer
19-08-10, 10:11 PM
Again, I was browsing through my LUA folder when I found this..
Simple chat system, allows both Horde & Alliance to chat with each other on a "channel". Like trade, but you don't have an option to leave. You can edit the Command for the Chat System to anything, however it can't be ".s" as those functions are client based, not server side. e.g. #chat, #c, #cc, #ch etc.
Chat System - Pastebin (http://www.pastebin.org/616079)
local ChatMsg = "#chat" -- Command for use of chat system
--[[ EDIT THE BELOW SCRIPT AT YOUR OWN RISK ]]--
function ChatSystem (event, player, message, type, language)
if (message:find(ChatMsg.." ") == 1) then
local text = message:gsub(ChatMsg.." ", "")
local plrs = GetPlayersInWorld()
for k, v in pairs(plrs) do
if (player:GetTeam() == 0) then -- Alliance
local GMrank = player:GetGmRank()
if (GMrank == 'az') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[Admin] |cffffff00["..player:GetName().."]: |cff00ff00"..text.."") -- Admin Tag
elseif (GMrank == 'a') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[GM] |cffffff00["..player:GetName().."]: |cff00ff00"..text.."") -- GM Tag
else
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cff00ff00[Alliance] |cffffff00["..player:GetName().."]: |cff00ff00"..text.."") -- Ally Tag
end
elseif (player:GetTeam() == 1) then -- Horde
local GMrank = player:GetGmRank()
if (GMrank == 'az') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[Admin] |cffffff00["..player:GetName().."]: |cffff0000"..text.."") -- Admin Tag
elseif (GMrank == 'a') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[GM] |cffffff00["..player:GetName().."]: |cffff0000"..text.."") -- GM Tag
else
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cffff0000[Horde] |cffffff00["..player:GetName().."]: |cffff0000"..text.."") -- Horde Tag
end
end
end
return 0
end
end
RegisterServerHook(16, "ChatSystem")
Simple chat system, allows both Horde & Alliance to chat with each other on a "channel". Like trade, but you don't have an option to leave. You can edit the Command for the Chat System to anything, however it can't be ".s" as those functions are client based, not server side. e.g. #chat, #c, #cc, #ch etc.
Chat System - Pastebin (http://www.pastebin.org/616079)
local ChatMsg = "#chat" -- Command for use of chat system
--[[ EDIT THE BELOW SCRIPT AT YOUR OWN RISK ]]--
function ChatSystem (event, player, message, type, language)
if (message:find(ChatMsg.." ") == 1) then
local text = message:gsub(ChatMsg.." ", "")
local plrs = GetPlayersInWorld()
for k, v in pairs(plrs) do
if (player:GetTeam() == 0) then -- Alliance
local GMrank = player:GetGmRank()
if (GMrank == 'az') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[Admin] |cffffff00["..player:GetName().."]: |cff00ff00"..text.."") -- Admin Tag
elseif (GMrank == 'a') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[GM] |cffffff00["..player:GetName().."]: |cff00ff00"..text.."") -- GM Tag
else
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cff00ff00[Alliance] |cffffff00["..player:GetName().."]: |cff00ff00"..text.."") -- Ally Tag
end
elseif (player:GetTeam() == 1) then -- Horde
local GMrank = player:GetGmRank()
if (GMrank == 'az') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[Admin] |cffffff00["..player:GetName().."]: |cffff0000"..text.."") -- Admin Tag
elseif (GMrank == 'a') then
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cFFFFA500[GM] |cffffff00["..player:GetName().."]: |cffff0000"..text.."") -- GM Tag
else
v:SendBroadcastMessage("|cFF00FFFF[LMS-Chat] |cffff0000[Horde] |cffffff00["..player:GetName().."]: |cffff0000"..text.."") -- Horde Tag
end
end
end
return 0
end
end
RegisterServerHook(16, "ChatSystem")