function MensagemTwitter(source, cmd, ...)
local MessagemT = table.concat ( { ... }, "T" )
local name = getPlayerName(source);
for _,v in ipairs(getElementsByType("player")) do
outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
end
end
addCommandHandler("Twitter", MensagemTwitter)
function MensagemAnon(source, cmd, ...)
local MessagemANS = table.concat ( { ... }, "T" );
for _,v in ipairs(getElementsByType("player")) do
outputChatBox("#ffffff[ #696969 [ BsB™DeepWeb ] #ffffff] #696969"..MessagemANS,v, 255, 255, 255, true)
end
end
addCommandHandler("DeepWeb", MensagemAnon)
function MensagemRP(source, cmd, ...)
local MessagemFRP = table.concat ( { ... }, "" );
local name = getPlayerName(source);
for _,v in ipairs(getElementsByType("player")) do
outputChatBox("#000000[ #ffffff [BsB™Fora RP]#000000] "..name.." #ffffff"..MessagemFRP,v, 255, 255, 255, true)
end
end
addCommandHandler("forarp", MensagemRP)
addEventHandler("onPlayerJoin", getRootElement(),
function()
bindKey(source, "Y", "down", "chatbox", "Twitter")
bindKey(source, "U", "down", "chatbox", "Deepweb")
bindKey(source, "i", "down", "chatbox", "forarp")
end
)
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
for index,player in pairs(getElementsByType("player")) do
bindKey(player,"Y", "down", "chatbox", "Twitter")
bindKey(player,"U", "down", "chatbox", "DeepWeb")
bindKey(player, "i", "down", "chatbox", "forarp")
end
end
)
chat_range=100
addEventHandler("onPlayerJoin",getRootElement(),
function ()
bindKey(source,"t","down","chatbox","ChatLocal")
end)
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
function ()
for index, player in pairs(getElementsByType("player")) do
bindKey(player,"t","down","chatbox","ChatLocal")
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("᠉ #00ff00 [ BsB™Local ] - #ffffff"..nick.."#00ff00 - #ffffff"..msg,v,r,g,b,true)
end
end
end
addCommandHandler("ChatLocal",onChat)
voce sabe pq o meu chat local quando eu do um comando por exemplo
/chat
aparece tudo no chat local ??