Jump to content

Jonas^

Members
  • Posts

    1,016
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Jonas^

  1. Cara, o MTA não tem nada ver com aquele blog, se você quer postar seus resources aconselho postar na nossa comunidade. Aquele blog é apenas um site que alguém abriu pra postar resources. https://community.multitheftauto.com/
  2. Corrigi algumas outras coisas, copie o código novamente, boa sorte aí na sua nova jornada. OBS: Sempre procure verificar as possíveis situações nunca esqueça disso, você esqueceu de verificar se o cara já estava com porte.
  3. local porte = createMarker (1491.136, -1768.475, 17.796, "cylinder", 2, 255, 0, 0, 50) function infoporte (hitElement, matchingDimension) if hitElement and getElementType (hitElement) == "player" and matchingDimension then outputChatBox ("#000000[INFO] #bababaPorte De Arma Custa R$300.000, Deseja Comprar? #FF0000[/comprarporte]", hitElement, 255, 255, 255, true) end end addEventHandler ("onMarkerHit", porte, infoporte) function comprarPorte (thePlayer, cmd) if isElementWithinMarker (thePlayer, porte) then if not (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("PorteDeArmas"))) then -- Se o jogador não estiver na acl 'PorteDeArmas', então: if getPlayerMoney(thePlayer) >= 300000 then takePlayerMoney (thePlayer, 300000) aclGroupAddObject (aclGetGroup("PorteDeArmas"), "user."..getAccountName(getPlayerAccount(thePlayer))) outputChatBox ("Agora você possúi porte de armas!", thePlayer, 0, 255, 0) else outputChatBox ("Erro! Você não tem dinheiro suficiente!", thePlayer, 255, 30, 30) end else outputChatBox ("Erro! Você já tem porte de armas!", thePlayer, 255, 30, 30) end else outputChatBox ("Erro! Você precisa estar na prefeitura para pegar o porte de armas!", thePlayer, 255, 30, 30) end end addCommandHandler ("comprarporte", comprarPorte)
  4. Verifique se o jogador esta no marker certo, assim: local skinmarker = createMarker (1565.1999511719, -1690.1999511719, 14.800000190735, 'cylinder', 2.0, 195, 107, 35, 202) addEventHandler ("onMarkerHit", root, function (hitElement, matchingDimension) if hitElement and getElementType (hitElement) == "player" and matchingDimension then if isElementWithinMarker (hitElement, skinmarker) then -- Se o jogador estiver no marker 'skinmarker', então: if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (hitElement)), aclGetGroup ("Policia")) then setElementModel (hitElement, 286) outputChatBox ("[PMERJ] Agora voce esta uniformizado para o trabalho!", hitElement, 0, 255, 0) else outputChatBox ("Você não é um policial", hitElement, 255, 0, 0) end end end end)
  5. Oque o Lord disse serve apenas para o onPlayerMarkerHit, no caso do meu código ele funciona igual o seu.
  6. Eu já tinha corrigido, só colocar ) no último end, ou copia o código de novo.
  7. Elemento player não existe. Faça assim: local skinmarker = createMarker (1565.1999511719, -1690.1999511719, 14.800000190735, 'cylinder', 2.0, 195, 107, 35, 202) addEventHandler ("onMarkerHit", root, function (hitElement, matchingDimension) if hitElement and getElementType (hitElement) == "player" and matchingDimension then if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (hitElement)), aclGetGroup ("Policia")) then setElementModel (hitElement, 286) outputChatBox ("[PMERJ] Agora voce esta uniformizado para o trabalho!", hitElement, 0, 255, 0) else outputChatBox ("Você não é um policial", hitElement, 255, 0, 0) end end end)
  8. local money = getPlayerMoney (localPlayer) local convertedMoney = convertNumber(money) if money > 99999999 then money = 99999999 end local cash = convertedMoney local stcash = tostring(convertedMoney) if #stcash == 1 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 2 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 3 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 4 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 5 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 6 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 7 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if #stcash == 8 then dxDrawText(" "..cash.."", x*1133, y*65, x*956, y*65, tocolor(255, 255, 255, 255), x*1.00, Font_1, "left", "top", false, false, false, false, false) dxDrawImage(x*1105, y*57, x*30, y*25, "Img/Carteira.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end
  9. Troque: local money = getPlayerMoney(localPlayer) Por: local money = ("%0d"):format (getPlayerMoney(getLocalPlayer()))
  10. Não esquece de deixar o like pra ajudar @MR.Kingos
  11. Tente verificar nessa função com a data do godmod. function sendHeadshot ( attacker, weapon, bodypart, loss ) if attacker == getLocalPlayer() then if bodypart == 9 then if getElementData (source, "invincible") then return end triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss ) setElementHealth ( source, 0 ) setPedHeadless( source, true ) end end end addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot ) addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot )
  12. Você tem que dar permissão admin ao painel. Desta forma: resource.(nome_do_resource) Se você é o rapaz que comprou um resource nosso me manda sua acl lá no discord que eu coloco pra você. Problema devidamente resolvido via privado no discord.
  13. https://wiki.multitheftauto.com/wiki/RemovePlayerFromVehicle
  14. É possível fazer sim utilizando o resource voice do MTA, mas é bem pouco provável que tenha um disponível na internet, pois é um pouco complexo e acho difícil alguém fazer de graça. -- Se tiver disposto a pagar pelo sistema pra que ele fique exatamente do jeito que você esta pensando, entre em contato no seguinte discord: Evolution Scripting#4527
  15. Sem código fica difícil .. Ué, é o mesmo botao pra tudo? if isCursorOnElement(sx/2 - 115, sy/2 + 165, 155, 23, x, y) then
  16. Esse Panel == 1 ai não seria Panel == true ?
  17. Sem sentido não abrir, você conseguiu estragar oque estava funcionando, eu testei aqui e abriu.
  18. client-side: local x, y = guiGetScreenSize () local painel = false function renderPanel () dxDrawLine(494 - 1, 98 - 1, 494 - 1, 552, tocolor(254, 254, 254, 108), 1, false) dxDrawLine(877, 98 - 1, 494 - 1, 98 - 1, tocolor(254, 254, 254, 108), 1, false) dxDrawLine(494 - 1, 552, 877, 552, tocolor(254, 254, 254, 108), 1, false) dxDrawLine(877, 552, 877, 98 - 1, tocolor(254, 254, 254, 108), 1, false) dxDrawRectangle(494, 98, 383, 454, tocolor(0, 0, 0, 149), false) dxDrawRectangle(494, 98, 383, 60, tocolor(255, 255, 255, 255), false) dxDrawText("Máfia Armas", 560, 108, 892, 148, tocolor(0, 0, 0, 254), 1.10, "bankgothic", "left", "top", false, false, false, false, false) dxDrawLine(508 - 1, 173 - 1, 508 - 1, 252, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(861, 173 - 1, 508 - 1, 173 - 1, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(508 - 1, 252, 861, 252, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(861, 252, 861, 173 - 1, tocolor(249, 249, 249, 122), 1, false) dxDrawRectangle(508, 173, 353, 79, tocolor(0, 0, 0, 254), false) dxDrawText("Pistola 9MM - 2500R$", 518, 193, 817, 222, tocolor(255, 255, 255, 255), 0.90, "bankgothic", "left", "top", false, false, false, false, false) dxDrawLine(508 - 1, 290 - 1, 508 - 1, 369, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(861, 290 - 1, 508 - 1, 290 - 1, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(508 - 1, 369, 861, 369, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(861, 369, 861, 290 - 1, tocolor(249, 249, 249, 122), 1, false) dxDrawRectangle(508, 290, 353, 79, tocolor(0, 0, 0, 254), false) dxDrawText("AK47 S/Coronha- 5000R$", 513, 317, 812, 346, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "left", "top", false, false, false, false, false) dxDrawLine(508 - 1, 406 - 1, 508 - 1, 485, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(861, 406 - 1, 508 - 1, 406 - 1, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(508 - 1, 485, 861, 485, tocolor(249, 249, 249, 122), 1, false) dxDrawLine(861, 485, 861, 406 - 1, tocolor(249, 249, 249, 122), 1, false) dxDrawRectangle(508, 406, 353, 79, tocolor(0, 0, 0, 254), false) dxDrawText("AK47 c/Coronha- 15000R$", 513, 429, 812, 458, tocolor(255, 255, 255, 255), 0.77, "bankgothic", "left", "top", false, false, false, false, false) end function startRender () if painel == false then addEventHandler ("onClientRender", root, renderPanel) showCursor (true) painel = true end end addEvent ("onRequestOpenPanel", true) addEventHandler ("onRequestOpenPanel", getRootElement(), startRender) function armas (_, state) if painel == true then if state == "down" then if isCursorOnElement (560, 108, 892, 148) then triggerServerEvent ("arma1", localPlayer) end end end end addEventHandler ("onClientClick", root, armas) function isCursorOnElement (x, y, w, h) local mx, my = getCursorPosition () local fullx, fully = guiGetScreenSize () cursorx,cursory = mx * fullx, my * fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end server-side: local PanelGun = createMarker (1503.3, -666.5, 95.5, 'cylinder', 1.5, 255, 255, 0, 170) addEventHandler ("onMarkerHit", PanelGun, function (hitElement, matchingDimension) outputChatBox ("#FF0000[BCR]#FFFFFF Compre Sua Arma", hitElement, 255, 0, 0, true) triggerClientEvent (hitElement, "onRequestOpenPanel", hitElement) end) function arma1 () giveWeapon (source, 22, 999, true) outputChatBox ("#00ff00BCR#ffffff )#ffff00Voce Pegou a #00ff00Pistola !", source, 255, 255, 255, true) end addEvent ("arma1", true) addEventHandler ("arma1", getRootElement(), arma1) -- Aconselho fazer em GUI
  19. Interessante descoberta uashasuas, o certo era a página da wiki do frozen ser atualizada informando isso.
  20. Estranho na wiki deveria informar que o frozen cancelava qualquer tipo de animação.
  21. https://wiki.multitheftauto.com/wiki/ShowCursor @Kraus MTA Se tiver com dúvidas ainda, poste o código aqui que posso te auxiliar. -- Eu aconselho você usar GUI pra essas situações mais simples, além de ser mais fácil de mexer, pelo que percebi você é novo na programação no MTA.
  22. Você postou na sessão errada. --- Você ira precisar de: https://wiki.multitheftauto.com/wiki/OnMarkerHit -- Quando colidir no marker vai chamar o trigger do onclientrender que ira mostrar o painel. https://wiki.multitheftauto.com/wiki/OnClientRender -- Evento que ira renderizar o painel. https://wiki.multitheftauto.com/wiki/TriggerServerEvent Trigger client > server pra dar a arma ao jogador e retirar dinheiro. https://wiki.multitheftauto.com/wiki/TriggerClientEvent -- Quando colidir no marker entra em conexão server > cliente pra receber o render do painel.
×
×
  • Create New...