Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CHAT = {}
- function ChatZor(event, player, message)
- if (message:find("#g") == 1) then
- for _, v in pairs(GetPlayersInWorld()) do
- if (not HasBlockedChat(v)) then
- if (player:GetGmRank() == 'az') then
- v:SendBroadcastMessage("|cFF00FFFF[Psicrest] |cFFFFA500[Admin] |cFFFF6060["..player:GetName().."]: |cFF32CD32"..message:gsub("#g ", ""))
- elseif (player:GetGmRank() == '1') then
- v:SendBroadcastMessage("|cFF00FFFF[Psicrest] |cFFFFA500[Trial GM] |cFFFF6060["..player:GetName().."]: |cFF32CD32"..message:gsub("#g ", ""))
- elseif (player:GetGmRank() == '2') then
- v:SendBroadcastMessage("|cFF00FFFF[Psicrest] |cFFFFA500[GM] |cFFFF6060["..player:GetName().."]: |cFF32CD32"..message:gsub("#g ", ""))
- elseif (player:GetGmRank() == '3') then
- v:SendBroadcastMessage("|cFF00FFFF[Psicrest] |cFFFFA500[Head GM] |cFFFF6060["..player:GetName().."]: |cFF32CD32"..message:gsub("#g ", ""))
- elseif (player:GetGmRank() == 'a') then
- v:SendBroadcastMessage("|cFF00FFFF[Psicrest] |cFFFFA500[Developer] |cFFFF6060["..player:GetName().."]: |cFF32CD32"..message:gsub("#g ", ""))
- elseif (player:GetGmRank() == 'g') then
- v:SendBroadcastMessage("|cFF00FFFF[Psicrest] |cFFFFA500[Vip] |cFFFF6060["..player:GetName().."]: |cFF32CD32"..message:gsub("#g ", ""))
- else
- v:SendBroadcastMessage("|cFF00FFFF[Psicrest] |cFFFF6060["..player:GetName().."]: |cFF32CD32"..message:gsub("#g ", ""))
- end
- end
- end
- return 0;
- end
- if (message == "#block chat") then
- if (not CHAT[tostring(player)]) then
- CHAT[tostring(player)] = {blocked = 0}
- end
- for k, v in pairs(CHAT) do
- if (k == tostring(player)) then
- if (v.blocked == 0) then
- v.blocked = 1
- player:SendBroadcastMessage("You have blocked the chat.")
- else
- player:SendBroadcastMessage("You already blocked the chat.")
- end
- end
- end
- return 0;
- end
- if (message == "#unblock chat") then
- if (not CHAT[tostring(player)]) then
- player:SendBroadcastMessage("You haven't blocked the chat.")
- end
- for k, v in pairs(CHAT) do
- if (k == tostring(player)) then
- if (v.blocked == 1) then
- v.blocked = 0
- player:SendBroadcastMessage("You have unblocked the chat.")
- else
- player:SendBroadcastMessage("You haven't blocked the chat.")
- end
- end
- end
- return 0;
- end
- if (message == "#chat check") then
- local bool
- if (HasBlockedChat(player)) then
- bool = "blocked"
- else
- bool = "not blocked"
- end
- player:SendBroadcastMessage("Status: "..bool)
- return 0;
- end
- if (message == "#check") then
- player:CastSpell(72521)
- return 0;
- end
- end
- function HasBlockedChat(plr)
- for k, v in pairs(CHAT) do
- if (k == tostring(plr)) then
- if (v.blocked == 1) then
- return true;
- end
- end
- end
- return false;
- end
- RegisterServerHook(16, "ChatZor")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement