glr como faz para aparecer alguma tag no chat RP do mta tipo #00BFFF[ Twitter ] #FFFFFF e uma segunda tag #00BFFFDono #FFFFFF ?
se alguem puder me ajudar agradeço ^^
chat que uso:
chat_range=100
addEventHandler("onPlayerJoin",getRootElement(),
function ()
bindKey(source,"o","down","chatbox","LocalChat")
end)
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
function ()
for index, player in pairs(getElementsByType("player")) do
bindKey(player,"o","down","chatbox","LocalChat")
end
end)
function isPlayerInRangeOfPoint(player,x,y,z,range)
local px,py,pz=getElementPosition(player)
return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range
end
function onChat(player,_,...)
local px,py,pz=getElementPosition(player)
local msg = table.concat({...}, " ")
local nick=getPlayerName(player)
local r,g,b = getTeamColor(getPlayerTeam(player))
for _,v in ipairs(getElementsByType("player")) do
if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then
outputChatBox("#00ff00ChatLocal #ffffff"..nick.."#00ff00 - #00ff00"..msg,v,r,g,b,true)
end
end
end
addCommandHandler("LocalChat",onChat)
function MensagemTwitter(source, cmd, ...)
local MessagemT = table.concat ( { ... }, " " )
local name = getPlayerName(source);
for _,v in ipairs(getElementsByType("player")) do
outputChatBox("#00BFFFTwitter #ffffff"..name.."#00BFFF - #00BFFF"..MessagemT,v, 255, 255, 255, true)
end
end
addCommandHandler("Twitter", MensagemTwitter)
addCommandHandler( "DeepWeb", function ( source, cmd, ... )
local message2 = #{...} > 0 and table.concat({...}," ") or nil
if message2 then
for _, p in ipairs (getElementsByType("player")) do
if hasObjectPermissionTo(p, "command.mute", true) then
outputChatBox("#696969DeepWeb #ffffff"..getPlayerName(source).."#696969 - #696969"..message2, p, 255, 255, 255, true)
else
outputChatBox("#696969DeepWeb #696969"..message2, p, 255, 255, 255, true)
end
end
else
end
end )
addCommandHandler( "staff", function ( source, cmd, ... )
local message2 = #{...} > 0 and table.concat({...}," ") or nil
if message2 then
for _, p in ipairs (getElementsByType("player")) do
if hasObjectPermissionTo(p, "command.mute", true) then
outputChatBox("#262523[ #696969#FFBA00STAFF #262523] #ffffff"..getPlayerName(source).."#696969 - #FFBA00"..message2, p, 255, 255, 255, true)
else
outputChatBox("#FFBA00STAFF #696969"..message2, p, 255, 255, 255, true)
end
end
else
end
end )
addEventHandler("onPlayerJoin", getRootElement(),
function()
bindKey(source, "i", "down", "chatbox", "Twitter")
end
)
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
for index,player in pairs(getElementsByType("player")) do
bindKey(player,"i", "down", "chatbox", "Twitter")
end
end
)
addEventHandler("onPlayerJoin", getRootElement(),
function()
bindKey(source, "u", "down", "chatbox", "DeepWeb")
end
)
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
for index,player in pairs(getElementsByType("player")) do
bindKey(player,"u", "down", "chatbox", "DeepWeb")
end
end
)
addEventHandler("onPlayerJoin", getRootElement(),
function()
bindKey(source, "x", "down", "chatbox", "staff")
end
)
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
for index,player in pairs(getElementsByType("player")) do
bindKey(player,"x", "down", "chatbox", "staff")
end
end
)