silva06GtaSa Posted July 31, 2022 Share Posted July 31, 2022 alguem poderia me da uma luz Por favor, estou a uns dias tentando vincular essa loja com um Inventario aqui, porem nao consigo fazer com que o dinheiro sujo apareça no inventario, eu assalto mostra que recebi o dinheiro mais nao mostra no inventario, ja coloquei o png do dinhei coloquei no meta tudo certo mas nao aparece no inventario de jeito nem um, ainda tentei ver se teria que vincular pelos elementdata mas no inventario nao tem o Elementdata do dinheiro sujo, apenas na loja , sera que o problema é esse? socorro kkk local Marker_Assalto1 = createMarker(765.82068, -1435.30688, 13.60301 -1, "cylinder", 1.2, 255, 0, 255, 50) local Blip_Loja = createBlipAttachedTo(Marker_Assalto1, 17) local Blip_Assaltada = createBlipAttachedTo(Marker_Assalto1, 20) setElementVisibleTo(Blip_Assaltada, root, false) local next = exports.inventoryHigh ----------------/ MENSAGEM - AVISO \---------------- function Mensagem_Aviso1(source) triggerClientEvent(source, "Zeed_Mensagem_Assalto1", getRootElement()) end addEventHandler("onMarkerHit", Marker_Assalto1, Mensagem_Aviso1) function Fechar_Mensagem1 (source) triggerClientEvent(source, "Zeed_Mensagem_Assalto1", getRootElement()) end addEventHandler("onMarkerLeave", Marker_Assalto1, Fechar_Mensagem1) -----------------------/ ASSALTO \----------------------- local helmetscaixa1 = {} function removehelmetcaixa1() if isElement(helmetscaixa1[source]) then destroyElement(helmetscaixa1[source]) helmetscaixa1[source] = nil end end addEventHandler("onPlayerQuit", getRootElement(), removehelmetcaixa1) addEventHandler("onPlayerWasted", getRootElement(), removehelmetcaixa1) function Iniciar_Assalto1 (source) --local Dinheiro_Sujo = getElementData(source, "TS:Sujo") or 0 local Valor_Ganho = math.random(58, 2120) -------------------------------------/ VALOR GANHO local Procurado = getPlayerWantedLevel(source) if isElementWithinMarker(source, Marker_Assalto1) then if getElementData(source, "Zeed_Assaltando2") then triggerClientEvent(source, "N3xT.dxNotification", root, "A Loja Já esta Sendo Assaltada, Aguarde", "error") return end if isObjectInACLGroup("user. "..getAccountName(getPlayerAccount(source)), aclGetGroup (Grupo_Acl_Policial)) then triggerClientEvent(source, "N3xT.dxNotification", root, "Você é um Policial, Proibido Assaltar.", "error") return end if getElementData(source, "Zeed_Loja_Assaltada2") then triggerClientEvent(source, "N3xT.dxNotification", root, "Loja Assaltada Recentemente, Aguarde.", "error") return end triggerClientEvent(source, "N3xT.dxNotification", root, "Assaltando, Aguarde.", "info") setPedAnimation(source, "INT_SHOP", "shop_cashier", -1, true, false, true) setElementData(source, "Zeed_Assaltando2", true) triggerClientEvent(root, "Zeed_Ligar_Alarme1", root, source) ----------------------------------/ Disparar o Alarme / iniciar alarme local helmetcaixa1 = createObject(1922,0,0,0) helmetscaixa1[source] = helmetcaixa1 --exports.bone_attach:attachElementToBone(helmetcaixa1,source,5,-0.1,-0.47,0.1,78,170,0) if Procurado < 6 then setPlayerWantedLevel(source, Procurado + 1) -------------------------------------/ QUANTIDADE ESTRELA end toggleAllControls(source, false) triggerClientEvent(source, "Zeed_Mensagem_Tempo1", getRootElement()) Loja_Assaltada (source) setTimer(function() setPedAnimation(source, nil) toggleAllControls(source, true) setElementData(source, "Zeed_Assaltando2", false) setElementData(source, "Zeed_Loja_Assaltada2", true) --setElementData(source, "TS:Sujo", Dinheiro_Sujo + Valor_Ganho) next:giveItem(source, "Dinheiro Sujo", Valor_Ganho) triggerClientEvent(source, "Zeed_Mensagem_Tempo1", getRootElement()) triggerClientEvent(source, "N3xT.dxNotification", root, "Loja Assaltada com sucesso, Roubo de: $"..Valor_Ganho.." limpe o Dinheiro sujo.", "success") end, Tempo_Assaltar_Loja*1000, 1) end end --[[function commandRemovehelmetcaixa1(player) if isElement(helmetscaixa1[player]) then destroyElement(helmetscaixa1[player]) helmetscaixa1[player] = nil end end addCommandHandler("dropbag", commandRemovehelmetcaixa1)]] -----------------------/ BIND - TECLA \----------------------- function restart() for i, v in ipairs(getElementsByType("player")) do bindKey ( v, Tecla_Assalto, "down", Iniciar_Assalto1 ) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), restart) function join() bindKey ( source, Tecla_Assalto, "down", Iniciar_Assalto1 ) end addEventHandler("onPlayerJoin", getRootElement(), join) -----------------------/ LOJA ASSALTAR - AVISAR POLICIAL \----------------------- function Loja_Assaltada (source) setElementVisibleTo(Blip_Loja, root, false) setElementVisibleTo(Blip_Assaltada, root, true) triggerClientEvent(root, "N3xT.dxNotification", root, "[ATENÇÃO] o jogador '"..getPlayerName(source).."' esta saqueando a Lojinha na principal, em Los Santos.", "info") setTimer(function() setElementVisibleTo(Blip_Loja, root, true) setElementVisibleTo(Blip_Assaltada, root, false) setElementData(source, "Zeed_Loja_Assaltada2", false) end, Tempo_Recuperar_Loja*60000, 1) end ----------------/ SALVAR - DADOS \---------------- function Finalizar_Assalto (conta) if not (isGuestAccount (conta)) then if (conta) then local source = getAccountPlayer(conta) setPedAnimation(source, nil) toggleAllControls(source, true) setElementData(source, "Zeed_Loja_Assaltada2", false) setElementData(source, "Zeed_Assaltando2", false) end end end ----------------/ SALVAR - DADOS \---------------- function Restart_Resource (source) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then Finalizar_Assalto(acc) end end end end addEventHandler("onResourceStart", getRootElement(), Restart_Resource) ----------------/ SALVAR - DADOS \---------------- addEventHandler("onPlayerLogin", root, function( _, acc ) setTimer(Finalizar_Assalto, 50, 1, acc) end ) ----------------/ SALVAR - DADOS \---------------- function Desligar_Resource ( res ) if res == getThisResource() then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then Finalizar_Assalto(acc) end end end end addEventHandler("onResourceStop", getRootElement(), Desligar_Resource ) function Verificar_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "TS:Sujo") or 0 outputChatBox("O jogador possui "..Dinheiro.."$ de dinheiro sujo!", source, 255, 255, 255, true) end end end end addCommandHandler("verificarsujo", Verificar_Dinheiro) function Remover_Dinheiro (source, cmd, id) if(id) then local playerID = tonumber(id) if(playerID) then local Conta = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..Conta, aclGetGroup("Policial")) then local Jogador = getPlayerID(playerID) local Dinheiro = getElementData(Jogador, "TS:Sujo") or 0 setElementData(Jogador, "TS:Sujo", 0) outputChatBox("Você removeu dinheiro sujo do jogador!", source, 255, 255, 255, true) end end end end addCommandHandler("removersujo", Remover_Dinheiro) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end 1 Link to comment
Administrators Tut Posted July 31, 2022 Administrators Share Posted July 31, 2022 I have moved this into the Portuguese scripting section for you. It will help that you format your code by using the Code <> button and inserting the code in there. That way it will be easily readable to those reviewing your code. It may also be a good idea to debug your code, as it is quite a long piece of code that you are asking others to review for you. 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