Jump to content

Joaovit13

Members
  • Posts

    70
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Joaovit13

  1. Olá, amigo tudo bem?

    Bom o senhor precisará fazer uma vistoria no seu servidor, pode ter alguns mods que tem muitos setElementDatas por exemplo,

    como também pode ser até mesmo a hospedagem que o senhor comprou.

    Espero ter ajudado!

  2. Olá, tudo bem?

    A partir do momento que ele iniciar a patrulha use: setElementData 

    Logo após faça uma verificação usando if, se ele estiver com a data caso ele estiver utilize o: setTimer criando uma função dentro dele aonde utiliza o:

    getPlayerMoney entregando o dinheiro desejado.

    Crie outra função aonde verifica se o jogador quitou ou caiu do servidor utilizando: onPlayerQuit e cancelando o evento utilizando: cancelEvent e retirando

    a data que a função setou nele. 

    Bom acho que é isso, Tenha uma Boa sorte!

    • Thanks 1
  3. Olá, tudo bem?

    Bem eu estava querendo adicionar águas nos esgotos do mta, porém acabei que chegando numa rua sem fim, tentei verificar as funções setWeather, setWeatherBlended. Porém elas foram feitas para mudar o clima da água, será que existe alguma função aonde teria como adicionar nos locais?

  4. Olá, tudo bem?

    Bom eu já tive esse problema e consegui resolver da seguinte forma:

    function isMouseInPosition(x, y, width, height)
        if(not isCursorShowing()) then 
            return false
        end
        local sx, sy = guiGetScreenSize()
        local cx, cy = getCursorPosition()
        local cx, cy = (cx * sx), (cy * sy)
        return((cx >= x and cx <= x + width) and (cy >= y and cy <= y + height))
    end

    E em vez de usar o isCursorElement use o isMouseInPostion().

    Ele funciona da seguinte forma dentro do painel dx aonde você deseja clicar use ele dessa forma como exemplo:

    if isMouseInPosition(screenW * 0.3133, screenH * 0.5768, screenW * 0.0836, screenH * 0.0794) then

    As posições dele deve ser a da posição do local aonde deseja clicar.

    Obs: A função isMouseInPosition deve estar no final do seu código do client.

  5. On 06/02/2021 at 11:53, Janela said:

    Esta Certo?
    ele fica piscando

    function portao1 (player)
        local arma = getPedWeapon (player)
          local wl = getPlayerWantedLevel (player)
            if getElementData (player, "Policial") == true then
               return extensions.scripts_Dxmessages: outputDx (player, "#CFCFCF (# 1E90FFINFO # CFCFCF) #ffffffVoce é Policia Não pode Roubar! "," error ")
           end
               if arma == 0 or arma == 1 or arma == 2 or arma == 3 or arma == 4 or arma == 5 or arma == 6 or arma == 7 or arma == 8 or arma == 9 or arma == 16 or arma == 17 or arma == 18 or arma == 19 or arma == 20 or arma == 21 or arma == 22 or arma == 23 or arma == 24 or arma == 26 or arma == 27 or arma == 28 or arma == 32 or arma == 33 or arma == 34 or arma == 46 or arma == 15 or arma == 42 then
               return export.scripts_Dxmessages:outputDx(player, "#CFCFCF (# 1E90FFINFO # CFCFCF) # ffffffVocê Precisa de um Fuzil (M4, AK-47, MP5)", "error")
           end
                if roubobanco1 == false then
               extensions.scripts_Dxmessages: outputDx(root, "#CFCFCF (# 1E90FFINFO # CFCFCF) #ffffffUm Assalto ao Banco Central Iniciado", 'info')
               moveObject(portao, 95000, 1137.8000488281, -1118.3000488281, 25)
               setPlayerWantedLevel(player, 6)
               --destroyElement ( player, 6)  roubo1)
           end
        setTimer (function ()
        setElementAlpha (roubo1, 0)
       end, 1, 0)
        setTimer (function ()
        setElementAlpha (roubo1, 80)
       end, 3000,0)
    end
    addEvent ("inicio", true)
    addEventHandler ("inicio", root, portao1)

    bom teve parte que você usou: ou/exportações/então. Tomei cuidado

  6. marker_aleatoriosS = {
        1872.08, -1308.8, 18.147,
        1893.097, -1314.732, 23.151,
        1892.831, -1316.274, 28.152,
        1872.101, -1317.594, 33.147,
        1876.034, -1321.604, 38.147,
        1876.088, -1309.743, 43.147,
        1873.865, -1322.412, 48.069,
        --Para não pegar repetido 
        1872.08, -1308.8, 18.147,
        1893.097, -1314.732, 23.151,
        1892.831, -1316.274, 28.152,
        1872.101, -1317.594, 33.147,
        1876.034, -1321.604, 38.147,
        1876.088, -1309.743, 43.147,
        1873.865, -1322.412, 48.069,
    }
    
    Object_ferro = {}
    marker_EntregarS = {}
    --ID do objeto barra de ferro 2960
    function pegarFerroS(player,cmd)
        local x, y, z = getElementPosition(marker_ferro)
        local Random_Pos = math.random(#marker_aleatoriosS)
            if not isPedInVehicle(player) then 
                if isElementWithinMarker(player, marker_ferro) then
                if getElementData(player, "Ferro") == false then
                    if getElementData(player, "Pedreiro") == true then
                        setPedAnimation(player, "CARRY", "liftup", 1.0, false)
                        setTimer(function()
                            if isElement(Object_ferro[player]) then destroyElement(Object_ferro[player]) end
                            if isElement(marker_EntregarS[player]) then destroyElement(marker_EntregarS) end
                            setElementData(player, "Recompensa", 0)
                            setPedAnimation(player, nil)
                            setElementData(player, "Ferro", true)
                            toggleControl(player, "jump", false)
                            toggleControl(player, "fire", false)
                            toggleControl(player, "aim_weapon", false)
                            setPedAnimation( player, "CARRY", "crry_prtial", 4.1, true, true, true )
                            marker_EntregarS[player] = createMarker ( marker_aleatoriosS[Random_Pos][1], marker_aleatoriosS[Random_Pos][2], marker_aleatoriosS[Random_Pos][3] -2.2, "cylinder", 2.5, 16, 111, 231, 50)
                            setElementVisibleTo(marker_EntregarS, root, false)
                            setElementVisibleTo(marker_EntregarS, player, true)
                            addEventHandler("onMarkerHit", marker_EntregarS[player], fim_Emprego)
                            Object_ferro[player] = createObject(2960, x, y, z)
                            exports.bone_attach:attachElementToBone(Object_ferro[player], player, 4, 0, 0.4, - 0.6, -90, 0, 0 )
                        end, 1000,1)
                    end
                end
            end
        end
    end
    addCommandHandler("ferro", pegarFerroS)

    Essa função está retornando erro no createMarker attemp to index upvalue 'Random_Pos' <a number value> não encontrei aonde está meu erro.

  7. 1 hour ago, André Lustosa said:

    como assim codigo?, não entendi...

    O arquivo .lua dele. mais antes tente ver se você realmente criou a tag no painel p em: Resource/Manage ACL/Create Group/nome do grupo/user.Seulogin para adicionar seu usuário no painel.

  8. Aproveitando essa postagem aqui é está 

    retornando esse erro aqui pra mim: attempt to index field

     

    --Marker_Aleatórios 
    marker_aleatoriosS = {
        1872.08, -1308.8, 18.147,
        1893.097, -1314.732, 23.151,
        1892.831, -1316.274, 28.152,
        1872.101, -1317.594, 33.147,
        1876.034, -1321.604, 38.147,
        1876.088, -1309.743, 43.147,
        1873.865, -1322.412, 48.069,
    }
    --Marker entregar
    marker_EntregarS = {}
    --Local Random_Pos
    local Random_Pos = math.random ( #marker_aleatoriosS)
    --Marker que está retornando o erro: attempt to index field
    marker_EntregarS[player] = createMarker(marker_aleatoriosS[Random_Pos][1], marker_aleatoriosS[Random_Pos][2], marker_aleatoriosS[Random_Pos][3] -2.2, "cylinder", 2.5, 16, 111, 231, 50)

    Obs é a mesma função ali de cima a unica diferença é que eu coloquei as marker_aleatoriosS e a marker_EntregarS

  9. function pegarFerroS(thePlayer)
        local x, y, z = getElementPosition(marker_aleatoriosS)
        local random_Pos = math.random(#marker_aleatoriosS)
        if thePlayer then
            player = getPlayerFromName(thePlayer)
            if not isPedInVehicle(player) then 
                if isElementWithinMarker(player, marker_ferro)
                if getElementData(player, "Ferro") == false then
                    if getElementData(player, "Pedreiro") == true then
                        setPedAnimation(player, "CARRY", "liftup", 1.0, false)
                        setTimer(function()
                            if isElement(Object_ferro[player]) then destroyElement(Object_ferro[player]) end
                            if isElement(marker_EntregarS[player]) then destroyElement(marker_EntregarS) end
                            setElementData(player, "Recompensa", 0)
                            setPedAnimation(player, nil)
                            setElementData(player, "Ferro", true)
                            toggleControl(player, "jump", false)
                            toggleControl(player, "fire", false)
                            toggleControl(player, "aim_weapon", false)
                            setPedAnimation( source, "CARRY", "crry_prtial", 4.1, true, true, true )
                            marker_EntregarS[player] = createMarker(marker_aleatoriosS[random_Pos[1]],marker_aleatoriosS[random_Pos[2]],marker_aleatoriosS[random_Pos[3]], -2.2, "cylinder", 2.5, 16, 111, 231, 50)
                            setElementVisibleTo(marker_EntregarS, root, false)
                            setElementVisibleTo(marker_EntregarS, player, true)
                            addEventHandler("onMarkerHit", marker_EntregarS[player], fim_Emprego)
                            Object_ferro[player] = createObject(2960, x, y, z)
                            exports.bone_attach:attachElementToBone(Object_Lixo[source], source, 4, 0, 0.4, - 0.6, -90, 0, 0 )
                            end, 1000,1)
                        end
                        end
                    end
                end
            end
        end
    end
    addCommandHandler("ferro", pegarFerroS)

    Está dando erro nos

    if getElementData(player, "Ferro") == false then
       if getElementData(player, "Pedreiro") == true then

    Não sei aonde estou errando o erro do debug está falando: 'then' expected near 'if'

×
×
  • Create New...