krazyY Posted October 3, 2019 Share Posted October 3, 2019 COMO COLOCAR TAG NO CHAT RP ? Link to comment
Luccas Posted October 3, 2019 Share Posted October 3, 2019 @krazyY, Por favor me envie o server-side do script de chat para que eu possa ajuda-lo. Link to comment
krazyY Posted October 3, 2019 Author Share Posted October 3, 2019 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 ?? Link to comment
Luccas Posted October 3, 2019 Share Posted October 3, 2019 26 minutes ago, krazyY said: 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 ?? O Gamemode "play" ou "freeroam" está ativado ? Link to comment
Luccas Posted October 3, 2019 Share Posted October 3, 2019 Just now, krazyY said: Freeroam Desliga ele, ele que está mandando a mensagem. Link to comment
krazyY Posted October 3, 2019 Author Share Posted October 3, 2019 Ok e como eu coloco a tag nesse CHAT RP ? Link to comment
Luccas Posted October 3, 2019 Share Posted October 3, 2019 (edited) 4 minutes ago, krazyY said: Ok e como eu coloco a tag nesse CHAT RP ? function MensagemTwitter(source, cmd, ...) local MessagemT = table.concat ( { ... }, "T" ) local name = getPlayerName(source); for _,v in ipairs(getElementsByType("player")) do conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) end end end addCommandHandler("Twitter", MensagemTwitter) function MensagemAnon(source, cmd, ...) local MessagemANS = table.concat ( { ... }, "T" ); for _,v in ipairs(getElementsByType("player")) do conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) end end end addCommandHandler("DeepWeb", MensagemAnon) function MensagemRP(source, cmd, ...) local MessagemFRP = table.concat ( { ... }, "" ); local name = getPlayerName(source); for _,v in ipairs(getElementsByType("player")) do conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) end 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 ) OBS: Não testado. Qualquer erro só enviar print do "/debugscript 3". OBS: Só mudar a posição do "Nome do grupo" para o "Everyone". Pois quem tem a tag geral não vai aparecer a tag se ela estiver acima. Edited October 3, 2019 by Luccas errado Link to comment
krazyY Posted October 3, 2019 Author Share Posted October 3, 2019 Acabei de ir testar, coloquei tudo certinho enao funcionou, não sei o q aconteceu n pego nenhum chat Twitter , deepweb esta como se fosse desativado nao aparece nada Link to comment
gabrielcosta Posted June 28, 2020 Share Posted June 28, 2020 On 03/10/2019 at 17:41, Luccas said: function MensagemTwitter(source, cmd, ...) local MessagemT = table.concat ( { ... }, "T" ) local name = getPlayerName(source); for _,v in ipairs(getElementsByType("player")) do conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™Twitter ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) end end end addCommandHandler("Twitter", MensagemTwitter) function MensagemAnon(source, cmd, ...) local MessagemANS = table.concat ( { ... }, "T" ); for _,v in ipairs(getElementsByType("player")) do conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™DeepWeb ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) end end end addCommandHandler("DeepWeb", MensagemAnon) function MensagemRP(source, cmd, ...) local MessagemFRP = table.concat ( { ... }, "" ); local name = getPlayerName(source); for _,v in ipairs(getElementsByType("player")) do conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Nome do grupo" ) ) then outputChatBox("#00BFFF[ BsB™ForaDoRp ] #FFFFFF [Tag] "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) end 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 ) OBS: Não testado. Qualquer erro só enviar print do "/debugscript 3". OBS: Só mudar a posição do "Nome do grupo" para o "Everyone". Pois quem tem a tag geral não vai aparecer a tag se ela estiver acima. Deu o seguinte erro: [20-06-28 01:30:10] ERROR: [Mods]/[BVN]Chat/Chats.Lua:142: attempt to concatenate global 'MessagemT' (a nil value) Link to comment
Other Languages Moderators Lord Henry Posted June 28, 2020 Other Languages Moderators Share Posted June 28, 2020 Troque a linha por essa. local MessagemT = table.concat ( { ... }, " " ) 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now