Advertisement
Guest User

WorldChat.lua

a guest
Sep 9th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. local ChatMsg = "#chat"
  2.  
  3. function WorldChat(event, player, message, type, language)
  4.     local startpos, endpos = string.find(message, ChatMsg)
  5.     if(startpos == 1) then
  6.     local text = message:gsub(ChatMsg, "")
  7.     local plrs = GetPlayersInWorld()
  8.     for k, v in pairs(plrs) do
  9.     local GMrank = player:GetGmRank()
  10.     local Faction = player:GetFaction()
  11.     if (GMrank == 'az') then
  12.     v:SendBroadcastMessage("|cFF3e3eff[Admin]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..text.."")
  13.     return false
  14.     elseif (GMrank == 'a') then
  15.     v:SendBroadcastMessage("|cFF3e3eff[GM]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..text.."")
  16.     return false
  17.     elseif (GMrank == 'v') then
  18.     v:SendBroadcastMessage("|cFFae00a8[VIP]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..text.."")
  19.     return false
  20.  
  21. else
  22.     v:SendBroadcastMessage("|cFF00ca34["..player:GetName().."]:|cFFFFA500"..text.."")
  23.     return false
  24. end
  25. end
  26. end
  27. end
  28.  
  29. RegisterServerHook(16, "WorldChat")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement