Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GM:ChatTextChanged(text)
- if PlayerColorsOn:GetInt() == 0 then return end
- if not Messagemode or HearMode == "speak" then return end
- local old = HearMode
- HearMode = "talk"
- if not GAMEMODE.Config.alltalk then
- if string.sub(text, 1, 2) == "//" or string.sub(string.lower(text), 1, 4) == "/ooc" or string.sub(string.lower(text), 1, 4) == "/a" then
- HearMode = "talk through OOC"
- elseif string.sub(string.lower(text), 1, 7) == "/advert" then
- HearMode = "advert"
- end
- end
- if string.sub(string.lower(text), 1, 3) == "/pm" then
- local plyname = string.sub(text, 5)
- if string.find(plyname, " ") then
- plyname = string.sub(plyname, 1, string.find(plyname, " ") - 1)
- end
- HearMode = "pm"
- playercolors = {}
- if plyname ~= "" and self:FindPlayer(plyname) then
- playercolors = {self:FindPlayer(plyname)}
- end
- elseif string.sub(string.lower(text), 1, 5) == "/call" then
- local plyname = string.sub(text, 7)
- if string.find(plyname, " ") then
- plyname = string.sub(plyname, 1, string.find(plyname, " ") - 1)
- end
- HearMode = "call"
- playercolors = {}
- if plyname ~= "" and self:FindPlayer(plyname) then
- playercolors = {self:FindPlayer(plyname)}
- end
- elseif string.sub(string.lower(text), 1, 3) == "/g " or GroupChat then
- HearMode = "group chat"
- local t = LocalPlayer():Team()
- playercolors = {}
- if t == TEAM_POLICE or t == TEAM_CHIEF or t == TEAM_MAYOR or t == TEAM_CPSUPPLIER or t == TEAM_SWAT or t == TEAM_CPSNIPER then
- for k, v in pairs(player.GetAll()) do
- if v ~= LocalPlayer() then
- local vt = v:Team()
- if vt == TEAM_POLICE or vt == TEAM_CHIEF or vt == TEAM_MAYOR or vt == TEAM_CPSUPPLIER or vt == TEAM_SWAT or vt == TEAM_CPSNIPER then table.insert(playercolors, v) end
- end
- end
- elseif t == TEAM_MOB or t == TEAM_GANG then
- for k, v in pairs(player.GetAll()) do
- if v ~= LocalPlayer() then
- local vt = v:Team()
- if vt == TEAM_MOB or vt == TEAM_GANG then table.insert(playercolors, v) end
- end
- end
- end
- elseif string.sub(string.lower(text), 1, 3) == "/w " then
- HearMode = "whisper"
- elseif string.sub(string.lower(text), 1, 2) == "/y" then
- HearMode = "yell"
- elseif string.sub(string.lower(text), 1, 3) == "/me" then
- HearMode = "me"
- end
- if old ~= HearMode then
- playercolors = {}
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement