Jump to content

Estou tentando fazer um sistema de lavar dinheiro


Recommended Posts

locais screenW , screenH = guiGetScreenSize ()

local exibir_painel = função falsa PainelDX () 
    dxDrawLine (( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , false ) 
    dxDrawLine 
                 ( telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) 
    dxDrawLine (( telaW * 0,3807 ) - 1 , tela H *                      0,7734 , telaW * 0,6208 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) 
    dxDrawLine ( telaW * 0,6208 , telaH * 0,7734 , telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 ,                0 , 245 ), 1 , falso ) 
    dxDrawRectangle ( telaW * 0,3807 , telaH * 0,1615 , telaW * 0,2401 , telaH * 0,6120 , tocolor ( 3 , 0 , 0 , 153 ), falso ) 
    dxDrawImage ( telaW * 0,4290 , telaH * 0,2227 , screenW * 0,1435              , screenH * 0.2747 , ": guieditor / images / examples / LavarMoney.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) 
    dxDrawText ( "Lavagem de Dinheiro" , screenW * 0.4305 , screenH * 0,1693 , tela W * 0,5652 , tela H * 0,2005 , tocolor ( 255 ,              255 , 255 , 255 ), 0,70 , "bankgothic" , "center" , "center" , false , false , false , false , false ) 
    dxDrawText ( "O dinheiro sujo pode ser lavado 100 mil por PenDrive com Trojan" , screenW * 0,4173 , tela H * 0,5117 , tela W * 0,5798 , tela H * 0,5638 , tocolor ( 255               , 255 , 255 , 255 ), 0,50 , "bankgothic" , "center" , "center" , false , true , false , false , false ) 
    dxDrawLine (( screenW * 0.4239 ) - 1 , ( screenH * 0.6237 ) - 1 , ( telaW * 0,4239 ) - 1 , telaH * 0,7018                        , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) 
    dxDrawLine ( telaW * 0,5798 , ( telaH * 0,6237 ) - 1 , ( telaW * 0,4239 ) - 1 , ( telaH * 0,6237 ) - 1 , tocolor ( 255 , 3 , 3 , 254 ),                      1 , falso ) 
    dxDrawLine (( telaW * 0,4239 ) - 1 , telaH * 0,7018 , telaW * 0,5798 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) 
    dxDrawLine ( telaW * 0,5798 , telaH * 0,7018 , screenW *               0.5798, (screenH * 0.6237) - 1, tocolor(255, 3, 3, 254), 1, false)
    dxDrawRectangle(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781, tocolor(11, 0, 0, 203), false)
    dxDrawText("Lavar", screenW * 0.4231, screenH * 0.6237, screenW * 0.5798, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
    dxDrawLine((screenW * 0.6040) - 1, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false)
    dxDrawLine(screenW * 0.6179, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false)
    dxDrawLine((screenW * 0.6040) - 1, screenH * 0.1953, screenW * 0.6179, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false)
    dxDrawLine(screenW * 0.6179, screenH * 0.1953, screenW * 0.6179, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false)
    dxDrawRectangle(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260, tocolor(0, 0, 0, 131), false)
    dxDrawText("X", screenW * 0.6032, screenH * 0.1693, screenW * 0.6179, screenH * 0.1953, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "center", "center", false, false, false, false, false)
end




addEvent("Exibir_Painel_Ao_Hitar_O_Marker", true)
addEventHandler("Exibir_Painel_Ao_Hitar_O_Marker", root, function()
    if exibir_painel == false then
        addEventHandler("onClientRender", getRootElement(), PainelDX)
        exibir_painel = true
        showCursor(true)
    else
        RemoveEventHandler("onClientRender", getRootElement(), PainelDX)
        exibir_painel = false
        showCursor(false)
    end
end)

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

-- Modified version for DX Text
function isCursorOverText(posX, posY, sizeX, sizeY)
    if ( not isCursorShowing( ) ) then
        return false
    end
    local cX, cY = getCursorPosition()
    local screenWidth, screenHeight = guiGetScreenSize()
    local cX, cY = (cX*screenWidth), (cY*screenHeight)

    return ( (cX >= posX and cX <= posX+(sizeX - posX)) and (cY >= posY and cY <= posY+(sizeY - posY)) )
end

addEventHandler("onClientClick", getRootElement(), function(button, state)
    if button == "left" and state == "down" then
        if exibir_painel == true then
            if isMouseInPosition(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260) then
                removeEventHandler("onClientRender", getRootElement(), PainelDX)
                exibir_painel = false
                showCursor(false)
            end
        end
    end
end)


local Sujo = getElementData(source, "moneysujo") or 0
addEventHandler("onClientClick", getRootElement(), function(button, state)
    if button == "left" and state == "down" then
        if exibir_painel == true then
            if isMouseInPosition(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781) then
                if Sujo >= 100000 and "PenDrive Com Trojan" then
                    setElementData(source, "moneysujo", -100000)
                    givePlayerMoney(source, givePlayerMoney(source)+100000)
                end
            end
        end
    end
end)

Estou fazendo um script com Painel DX e estou tendo problema na parte de limpar o dinheiro pois não está funcionando eu clicko no botão de "Lavar" e não tira os 100k de dinheiro sujo para virar 100k limpo além disso para conseguir fazer essa lavagem com o dinheiro precisa está com um PenDrive com Trojan para cada lavagem de dinheiro, ou seja, cada pendrive lava 100k alguem pode me ajudar

Imagem do painel: https://uploaddeimagens.com.br/imagens/NXxdneg

Edited by ~Guh.?
Link to post
  • ~Guh.? changed the title to Estou tentando fazer um sistema de lavar dinheiro

Olá.

Você está tentando obter o dinheiro sujo do jogador fora da função, e ainda usando o parâmetro errado. Não existe source dessa forma no client-side, use localPlayer. Também, deixe aquela variável dentro do escopo onde será executado o código.

Aquele "PenDrive Com Trojan" não faz sentido. De onde ele está vindo?

Link to post
On 26/03/2021 at 02:32, ~Guh.? said:

locais screenW , screenH = guiGetScreenSize ()

local exibir_painel = função falsa PainelDX () 
    dxDrawLine (( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , false ) 
    dxDrawLine 
                 ( telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) 
    dxDrawLine (( telaW * 0,3807 ) - 1 , tela H *                      0,7734 , telaW * 0,6208 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) 
    dxDrawLine ( telaW * 0,6208 , telaH * 0,7734 , telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 ,                0 , 245 ), 1 , falso ) 
    dxDrawRectangle ( telaW * 0,3807 , telaH * 0,1615 , telaW * 0,2401 , telaH * 0,6120 , tocolor ( 3 , 0 , 0 , 153 ), falso ) 
    dxDrawImage ( telaW * 0,4290 , telaH * 0,2227 , screenW * 0,1435              , screenH * 0.2747 , ": guieditor / images / examples / LavarMoney.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) 
    dxDrawText ( "Lavagem de Dinheiro" , screenW * 0.4305 , screenH * 0,1693 , tela W * 0,5652 , tela H * 0,2005 , tocolor ( 255 ,              255 , 255 , 255 ), 0,70 , "bankgothic" , "center" , "center" , false , false , false , false , false ) 
    dxDrawText ( "O dinheiro sujo pode ser lavado 100 mil por PenDrive com Trojan" , screenW * 0,4173 , tela H * 0,5117 , tela W * 0,5798 , tela H * 0,5638 , tocolor ( 255               , 255 , 255 , 255 ), 0,50 , "bankgothic" , "center" , "center" , false , true , false , false , false ) 
    dxDrawLine (( screenW * 0.4239 ) - 1 , ( screenH * 0.6237 ) - 1 , ( telaW * 0,4239 ) - 1 , telaH * 0,7018                        , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) 
    dxDrawLine ( telaW * 0,5798 , ( telaH * 0,6237 ) - 1 , ( telaW * 0,4239 ) - 1 , ( telaH * 0,6237 ) - 1 , tocolor ( 255 , 3 , 3 , 254 ),                      1 , falso ) 
    dxDrawLine (( telaW * 0,4239 ) - 1 , telaH * 0,7018 , telaW * 0,5798 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) 
    dxDrawLine ( telaW * 0,5798 , telaH * 0,7018 , screenW *               0.5798, (screenH * 0.6237) - 1, tocolor(255, 3, 3, 254), 1, false)
    dxDrawRectangle(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781, tocolor(11, 0, 0, 203), false)
    dxDrawText("Lavar", screenW * 0.4231, screenH * 0.6237, screenW * 0.5798, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false)
    dxDrawLine((screenW * 0.6040) - 1, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false)
    dxDrawLine(screenW * 0.6179, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false)
    dxDrawLine((screenW * 0.6040) - 1, screenH * 0.1953, screenW * 0.6179, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false)
    dxDrawLine(screenW * 0.6179, screenH * 0.1953, screenW * 0.6179, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false)
    dxDrawRectangle(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260, tocolor(0, 0, 0, 131), false)
    dxDrawText("X", screenW * 0.6032, screenH * 0.1693, screenW * 0.6179, screenH * 0.1953, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "center", "center", false, false, false, false, false)
end




addEvent("Exibir_Painel_Ao_Hitar_O_Marker", true)
addEventHandler("Exibir_Painel_Ao_Hitar_O_Marker", root, function()
    if exibir_painel == false then
        addEventHandler("onClientRender", getRootElement(), PainelDX)
        exibir_painel = true
        showCursor(true)
    else
        RemoveEventHandler("onClientRender", getRootElement(), PainelDX)
        exibir_painel = false
        showCursor(false)
    end
end)

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

-- Modified version for DX Text
function isCursorOverText(posX, posY, sizeX, sizeY)
    if ( not isCursorShowing( ) ) then
        return false
    end
    local cX, cY = getCursorPosition()
    local screenWidth, screenHeight = guiGetScreenSize()
    local cX, cY = (cX*screenWidth), (cY*screenHeight)

    return ( (cX >= posX and cX <= posX+(sizeX - posX)) and (cY >= posY and cY <= posY+(sizeY - posY)) )
end

addEventHandler("onClientClick", getRootElement(), function(button, state)
    if button == "left" and state == "down" then
        if exibir_painel == true then
            if isMouseInPosition(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260) then
                removeEventHandler("onClientRender", getRootElement(), PainelDX)
                exibir_painel = false
                showCursor(false)
            end
        end
    end
end)


local Sujo = getElementData(source, "moneysujo") or 0
addEventHandler("onClientClick", getRootElement(), function(button, state)
    if button == "left" and state == "down" then
        if exibir_painel == true then
            if isMouseInPosition(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781) then
                if Sujo >= 100000 and "PenDrive Com Trojan" then
                    setElementData(source, "moneysujo", -100000)
                    givePlayerMoney(source, givePlayerMoney(source)+100000)
                end
            end
        end
    end
end)

Estou fazendo um script com Painel DX e estou tendo problema na parte de limpar o dinheiro pois não está funcionando eu clicko no botão de "Lavar" e não tira os 100k de dinheiro sujo para virar 100k limpo além disso para conseguir fazer essa lavagem com o dinheiro precisa está com um PenDrive com Trojan para cada lavagem de dinheiro, ou seja, cada pendrive lava 100k alguem pode me ajudar

Imagem do painel: https://uploaddeimagens.com.br/imagens/NXxdneg

Só pra complementar a resposta

setElementData(source, "moneysujo", -100000)

na verdade era pra ser

 

setElementData(source, "moneysujo", Sujo - 100000)
Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...