Mec.Love Posted April 22, 2020 Share Posted April 22, 2020 (edited) Estou usando um MOD de chat para meu servidor RP, Porém ele está dando erro na linha 252 sendo a seguinte if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #00bfffTwitter ✗ #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) sendo o erro o seguinte Bad argument @'getElementData' [Expected element at argument1, got nill] em quase todas as linhas iguais a essa está dando esse erro. EDIT* Codigo da source toda -------------------------------------------------------------------------------------------- DistanciaDoChatLocal = 220 -- Metros MensagemFalandoRapidoDemaisLocal = '#ffffff[ #00ffffAnti Flood #ffffff] - #ffffffVocê Esta Digitando Muito Rapido, Aguarde 3 Segundos' ComandoDoChatADM = "g" -- Ex /g Mensagem ComandoDoChatOLX = "olx" -- Ex /olx Mensagem ComandoDoChatFRP = "frp" -- Ex /frp Mensagem ComandoDoChatTWT = "twt" -- Ex /twt Mensagem ComandoDoChatANM = "@" -- Ex /@ Mensagem ValorDoChatOLX = 500 -- Dinheiro ValorDoChatGlobal = 0 -- Dinheiro MensagemFalandoRapidoDemaisGlobal = '#ffffff[ #00ffffAnti Flood #ffffff] - #ffffffVocê está digitando muito rapido, aguarde 5 segundos.' MensagemVoceEstaMutadoGlobal = '#ffffff[ #00ffffAviso #ffffff] - #ffffffVocê está mutado, e não podera utilizar o chat.' MensagemDinheiroInsuficienteOLX = '#ffffff[ #00ffffAviso #ffffff] - #ffffffVocê precisa de #00ff00R$#ffffff '..ValorDoChatOLX..' para (Divulgar) a sua Venda neste chat.' AvisoDoValorDaMensagemOLX = '#ffffff[ #00ffffAviso #ffffff] - #ffffffO Chat custa #00ff00R$#ffffff '..ValorDoChatOLX..' para cada mensagem enviada' -------------------------------------------------------------------------------------------- -- Config do Chat Local local GRUPOS = {"Console","Admin","SuperModerator","Moderator","Everyone"} local function isPlayerInACL(player) local accName = getAccountName(getPlayerAccount(player)) for _, theGroup in ipairs(GRUPOS) do if isObjectInACLGroup("user."..accName,aclGetGroup(theGroup)) then return true end end return false end addEventHandler("onPlayerChat", root, function(tresc, msgtype) if (msgtype == 0) then cancelEvent() local IDS = getElementData(source, "ID") local x,y,z = getElementPosition(source) for key, gracze in ipairs(getElementsByType("player")) do local x2,y2,z2 = getElementPosition(gracze) if getElementData (source, "ChatLocal:Delay", true) then outputChatBox ( MensagemFalandoRapidoDemaisLocal, source, 255, 255, 255, true ) return end if ( getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) < DistanciaDoChatLocal ) then local int = getElementInterior ( source ) local dim = getElementDimension ( source ) local int2 = getElementInterior ( gracze ) local dim2 = getElementDimension ( gracze ) if ( int == int2 and dim == dim2 ) then conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #ffff00Local #ffffff] #ffff00Fundador #ffffff "..getPlayerName(source).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#ffffff[ #00F5FFLocal #ffffff] #ffff00Admin #ffffff "..getPlayerName(source).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ffffff[ #00F5FFLocal #ffffff] #ffff00S.MOD #ffffff "..getPlayerName(source).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#ffffff[ #00F5FFLocal #ffffff] #ffff00Moderador #ffffff "..getPlayerName(source).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[ #00F5FFLocal #ffffff] "..getPlayerName(source).. " #00F5FF(#ffffffID:"..getElementData(source, "ID").."#00F5FF)#ffffff :#ffffff "..tresc, gracze, 255, 255, 255, true) end end end end end setElementData (source, "ChatLocal:Delay",true) setTimer (setElementData, 3000, 1, source, "ChatLocal:Delay", false) end) -------------------------------------------------------------------------------------------- -- Config do Chat ADM function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if ( isPlayerMuted(thePlayer) ) then outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local money = getPlayerMoney(thePlayer) if (money < ValorDoChatGlobal ) then outputChatBox ( MensagemDinheiroInsuficienteGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #ffff00STAFF #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#ffffff[ #00F5FFSTAFF #ffffff] #ffff00Admin #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ffffff[ #00F5FFSTAFF #ffffff] #ffff00S.MOD #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#ffffff[ #00F5FFSTAFF #ffffff] #ffff00Moderador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) end end end end if not getElementData( thePlayer, "ChatGlobal:Avisado", true ) then outputChatBox ( AvisoDoValorDaMensagemGlobal, thePlayer, 255, 255, 255, true ) end setElementData ( thePlayer, "ChatGlobal:Avisado", true ) takePlayerMoney ( thePlayer, ValorDoChatGlobal ) setElementData ( thePlayer, "ChatGlobal:Delay1",true ) setTimer ( setElementData, 5000, 1, thePlayer, "ChatGlobal:Delay1", false ) end addCommandHandler ( ComandoDoChatADM, adminchat ) -------------------------------------------------------------------------------------------- -- Config do Chat OLX function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if ( isPlayerMuted(thePlayer) ) then outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end if getElementData (thePlayer, "ChatOLX:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local money = getPlayerMoney(thePlayer) if (money < ValorDoChatOLX ) then outputChatBox ( MensagemDinheiroInsuficienteOLX, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #a020f0OLX ✓ #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#ffffff[ #a020f0OLX ✓ #ffffff] #ffff00Admin #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ffffff[ #a020f0OLX ✓ #ffffff] #ffff00S.MOD #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#ffffff[ #a020f0OLX ✓ #ffffff] #ffff00Moderador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[ #a020f0OLX ✓ #ffffff] "..getPlayerName(thePlayer).." #a020f0(#ffffffID:"..getElementData(thePlayer, "ID").."#a020f0)#ffffff :#ffffff "..message, player, 255, 255, 255, true) end end end end if not getElementData( thePlayer, "ChatOLX:Avisado", true ) then outputChatBox ( AvisoDoValorDaMensagemOLX, thePlayer, 255, 255, 255, true ) end setElementData ( thePlayer, "ChatOLX:Avisado", true ) takePlayerMoney ( thePlayer, ValorDoChatOLX ) setElementData ( thePlayer, "ChatOLX:Delay1",true ) setTimer ( setElementData, 5000, 1, thePlayer, "ChatOLX:Delay1", false ) end addCommandHandler ( ComandoDoChatOLX, adminchat ) -------------------------------------------------------------------------------------------- -- Config do Chat Fora do RP function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if ( isPlayerMuted(thePlayer) ) then outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local money = getPlayerMoney(thePlayer) if (money < ValorDoChatGlobal ) then outputChatBox ( MensagemDinheiroInsuficienteGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #00ff00Fora do RP ✗ #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#ffffff[ #00ff00Fora do RP ✗ #ffffff] #ffff00Admin #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ffffff[ #00ff00Fora do RP ✗ #ffffff] #ffff00S.MOD #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#ffffff[ #00ff00Fora do RP ✗ #ffffff] #ffff00Moderador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[ #00ff00Fora do RP ✗ #ffffff] "..getPlayerName(thePlayer).." #00FF00(#ffffffID:"..getElementData(thePlayer, "ID").."#00FF00) #ffffff : #ffffff"..message, player, 255, 255, 255, true) end end end end --if not getElementData( thePlayer, "ChatGlobal:Avisado", true ) then --outputChatBox ( AvisoDoValorDaMensagemGlobal, thePlayer, 255, 255, 255, true ) --end --setElementData ( thePlayer, "ChatGlobal:Avisado", true ) --takePlayerMoney ( thePlayer, ValorDoChatGlobal ) --setElementData ( thePlayer, "ChatGlobal:Delay1",true ) -- setTimer ( setElementData, 5000, 1, thePlayer, "ChatGlobal:Delay1", false ) end addCommandHandler ( ComandoDoChatFRP, adminchat ) -------------------------------------------------------------------------------------------- -- Config do Chat Twitter function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if ( isPlayerMuted(thePlayer) ) then outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local money = getPlayerMoney(thePlayer) if (money < ValorDoChatGlobal ) then outputChatBox ( MensagemDinheiroInsuficienteGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #00bfffTwitter ✗ #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#ffffff[ #00bfffTwitter ✗ #ffffff] #ffff00Admin #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ffffff[ #00bfffTwitter ✗ #ffffff] #ffff00S.MOD #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#ffffff[ #00bfffTwitter #ffffff] #ffff00Moderador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[ #00bfffTwitter #ffffff] "..getPlayerName(thePlayer).." #00bfff(#ffffffID:"..getElementData(thePlayer, "ID").."#00bfff) #ffffff : #ffffff"..message, player, 255, 255, 255, true) end end end end if not getElementData( thePlayer, "ChatGlobal:Avisado", true ) then outputChatBox ( AvisoDoValorDaMensagemGlobal, thePlayer, 255, 255, 255, true ) end setElementData ( thePlayer, "ChatGlobal:Avisado", true ) takePlayerMoney ( thePlayer, ValorDoChatGlobal ) setElementData ( thePlayer, "ChatGlobal:Delay1",true ) setTimer ( setElementData, 5000, 1, thePlayer, "ChatGlobal:Delay1", false ) end addCommandHandler ( ComandoDoChatTWT, adminchat ) -------------------------------------------------------------------------------------------- -- Config do Chat Anonimo function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then if ( isPlayerMuted(thePlayer) ) then outputChatBox ( MensagemVoceEstaMutadoGlobal, thePlayer, 255, 255, 255, true ) return end if getElementData (thePlayer, "ChatGlobal:Delay1", true) then outputChatBox ( MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true ) return end local money = getPlayerMoney(thePlayer) if (money < ValorDoChatGlobal ) then outputChatBox ( MensagemDinheiroInsuficienteGlobal, thePlayer, 255, 255, 255, true ) return end conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #9c9c9c@ Anônimo #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("#ffffff[ #9c9c9c@ Anônimo #ffffff] #ffff00Admin #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ffffff[ #9c9c9c@ Anônimo #ffffff] #ffff00S.MOD #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Moderator" ) ) then outputChatBox("#ffffff[ #9c9c9c@ Anônimo #ffffff] #ffff00Moderador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then outputChatBox("#ffffff[ #9c9c9c@ Anônimo #ffffff] #ffffff"..message, player, 255, 255, 255, true) end end end end if not getElementData( thePlayer, "ChatGlobal:Avisado", true ) then outputChatBox ( AvisoDoValorDaMensagemGlobal, thePlayer, 255, 255, 255, true ) end setElementData ( thePlayer, "ChatGlobal:Avisado", true ) takePlayerMoney ( thePlayer, ValorDoChatGlobal ) setElementData ( thePlayer, "ChatGlobal:Delay1",true ) setTimer ( setElementData, 100, 1, thePlayer, "ChatGlobal:Delay1", false ) for _, staff in ipairs ( getElementsByType ( "player" ) ) do if isPlayerInACL(staff) then outputChatBox("#ffffff[ #9c9c9c@ Anônimo #ffffff] "..getPlayerName(thePlayer).."#ffffff: "..message, staff, 255, 255, 255, true) end end end addCommandHandler ( ComandoDoChatANM, adminchat ) -------------------------------------------------------------------------------------------- function isPlayerOnGroup ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local inGroup = false for _, group in ipairs ( { "Everyone" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then inGroup = true break end end return inGroup end -------------------------------------------------------------------------------------------- Edited April 22, 2020 by Mec.Love Link to comment
Mec.Love Posted April 22, 2020 Author Share Posted April 22, 2020 puts, desculpa achei o erro... Estava na minha cara codigo com erro if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #00bfffTwitter ✗ #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(source, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) codigo sem erro if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("#ffffff[ #00bfffTwitter ✗ #ffffff] #ffff00Fundador #ffffff "..getPlayerName(thePlayer).. " #ffff00(#ffffffID:"..getElementData(thePlayer, "ID").."#ffff00)#ffffff :#ffff00 "..message, player, 255, 255, 255, true) 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