BlackinSCR Posted April 20, 2021 Share Posted April 20, 2021 (edited) Eai rapaziada, eu estou tentando colocar o CHAT ANONIMO no meu servidor e que apareça o nome do player somente para quem está na ACL "Staff", mas quando algum player manda mesnagem, o nick dele não aparece para mim, me ajuda ai porfavor. function adminchat4 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("* #bfbfbfDeep Web - "..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( ComandoDoChatGlobal4, adminchat4 ) Edited April 20, 2021 by BlackinSCR Link to comment
Blaack Posted April 21, 2021 Share Posted April 21, 2021 (edited) On 20/04/2021 at 11:34, BlackinSCR said: Eai rapaziada, eu estou tentando colocar o CHAT ANONIMO no meu servidor e que apareça o nome do player somente para quem está na ACL "Staff", mas quando algum player manda mesnagem, o nick dele não aparece para mim, me ajuda ai porfavor. function adminchat4 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("* #bfbfbfDeep Web - "..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( ComandoDoChatGlobal4, adminchat4 ) Bom vamos lá! @BlackinSCR Gostei do nick haha' function adminchat4 ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local conta = getAccountName(getPlayerAccount(player)) -- Aqui voce deve verificar para quem irá aparcer a mensagem (player definido no for) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Staff" ) ) then outputChatBox("* #bfbfbfDeep Web - #ffffff"..getPlayerName(thePlayer).. " ("..getPlayerID(thePlayer)..") #bfbfbf- "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("* #bfbfbfDeep Web - "..message, player, 255, 255, 255, true) end end end end setElementData ( thePlayer, "ChatGlobal:Delay2",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay2", false ) end addCommandHandler ( ComandoDoChatGlobal4, adminchat4 ) Edited April 21, 2021 by Lord Henry Script convertido de HTML para Lua. 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