Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rpChat( source, message, mType)
- if (isPlayerMuted(source)) then
- outputChatBox("You can not use interactions while being muted!", source, 255, 0, 0)
- return
- end
- if (not message) then return end
- message = message:gsub("#%x%x%x%x%x%x", "")
- if (message == "") then return end
- if exports.GTIres:isPlayerBannedSQL(source) then
- outputChatBox("You can not chat while being banned", source, 255, 0, 0)
- return
- end
- local r, g, b = getPlayerNametagColor(source)
- local hex = getHexFromRGB(r, g, b)
- local posX, posY, posZ = getElementPosition(source)
- local recipients = {}
- for index, player2 in pairs(getElementsByType("player")) do
- local posX2, posY2, posZ2 = getElementPosition(player2)
- if (--[[player ~= player2 and--]] getDistanceBetweenPoints3D(posX, posY, posZ, posX2, posY2, posZ2)) <= 30 then
- table.insert(recipients, player2)
- end
- end
- for index, player2 in pairs(recipients) do
- if mType == "me" then
- outputChatBox("[ME]["..#recipients.."] *"..getPlayerName(source).." "..message, player2, 255, 0, 255, false)
- logSocialMessage( "", "[ME]["..#recipients.."] *"..getPlayerName(source).." "..message, "action", 1, "Interactions", "RP Chat", "player")
- elseif mType == "do" then
- outputChatBox("[DO]["..#recipients.."] *"..getPlayerName(source)..": "..message, player2, 255, 0, 255, false)
- logSocialMessage( "", "[DO]["..#recipients.."] *"..getPlayerName(source)..": "..message, "action", 1, "Interactions", "RP Chat", "player")
- end
- end
- end
- function localChat(player, _, ...)
- if (isPlayerMuted(player)) then
- outputChatBox("You can not chat while being muted!", player, 255, 0, 0)
- return
- end
- local message = table.concat({...}, " ")
- if (not message) then return end
- message = message:gsub("#%x%x%x%x%x%x", "")
- if (message == "") then return end
- local r, g, b = getPlayerNametagColor(player)
- local hex = getHexFromRGB(r, g, b)
- local posX, posY, posZ = getElementPosition(player)
- local recipients = {}
- for index, player2 in pairs(getElementsByType("player")) do
- local posX2, posY2, posZ2 = getElementPosition(player2)
- if (--[[player ~= player2 and--]] getDistanceBetweenPoints3D(posX, posY, posZ, posX2, posY2, posZ2)) <= 30 then
- table.insert(recipients, player2)
- end
- end
- if exports.GTIres:isPlayerBannedSQL(player) then
- outputChatBox("You can not chat while being banned", player, 255, 0, 0)
- return
- end
- --local detection = string.gsub( message, "/")
- if string.find( message, "/me", 1, true) then
- --outputChatBox( "You tried entering a command in localchat.", player, 255, 0, 0)
- local message1 = string.gsub( message, "/me ", "")
- if message1 ~= "" then
- rpChat( player, message1, "me")
- return
- end
- elseif string.find( message, "/do", 1, true) then
- --outputChatBox( "You tried entering a command in localchat.", player, 255, 0, 0)
- local message1 = string.gsub( message, "/do ", "")
- if message1 ~= "" then
- rpChat( player, message1, "do")
- return
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment