SHOW:
|
|
- or go back to the newest paste.
1 | local ChatMsg = "#chat" | |
2 | ||
3 | - | function WorldChat(event, player, message, type, language) |
3 | + | local function WorldChat(event, player, message, type, language) |
4 | - | local startpos, endpos = string.find(message, ChatMsg) |
4 | + | if(string.find(message, ChatMsg) == 1) then |
5 | - | if(startpos == 1) then |
5 | + | message = message:gsub(ChatMsg, "") |
6 | - | local text = message:gsub(ChatMsg, "") |
6 | + | if (GMrank == 'az') then |
7 | - | local plrs = GetPlayersInWorld() |
7 | + | message = "|cFF3e3eff[Admin]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..message |
8 | - | for k, v in pairs(plrs) do |
8 | + | elseif (GMrank == 'a') then |
9 | - | local GMrank = player:GetGmRank() |
9 | + | message = "|cFF3e3eff[GM]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..message |
10 | - | local Faction = player:GetFaction() |
10 | + | elseif (GMrank == 'v') then |
11 | - | if (GMrank == 'az') then |
11 | + | message = "|cFF3e3eff[VIP]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..message |
12 | - | v:SendBroadcastMessage("|cFF3e3eff[Admin]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..text.."") |
12 | + | else |
13 | - | return false |
13 | + | message = "|cFF00ca34["..player:GetName().."]:|cFFFFA500"..message |
14 | - | elseif (GMrank == 'a') then |
14 | + | end |
15 | - | v:SendBroadcastMessage("|cFF3e3eff[GM]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..text.."") |
15 | + | SendWorldMessage(message, 2) |
16 | - | return false |
16 | + | return false |
17 | - | elseif (GMrank == 'v') then |
17 | + | end |
18 | - | v:SendBroadcastMessage("|cFFae00a8[VIP]|cFF00ca34["..player:GetName().."]:|cFFFFA500"..text.."") |
18 | + | |
19 | - | return false |
19 | + | |
20 | RegisterServerHook(16, WorldChat) |