Jump to content

Ajuda com dxDrawImage [resolvido]


Recommended Posts

Eu preciso que quando ligar o Night, ou o Infrared, aparecer uma certa imagem na tela, só que...

Ela aparece e some muito rápido, preciso que ela fique ate eu desativar o Night/Infrared novamente.

function playerZoom (key,keyState) 
local screenW, screenH = guiGetScreenSize() 
    if (key == "n") then 
        if (getElementData(getLocalPlayer(),"Night Vision Goggles") > 0) then 
            if nightvision then 
                nightvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
            else  
                nightvision = true 
                dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, "IMAGE.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "nightvision") 
            end 
        end 
    elseif (key == "i") then 
        if (getElementData(getLocalPlayer(),"Infrared Goggles") > 0) then 
            if infaredvision then 
                infaredvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
            else  
                infaredvision = true 
                dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, "IMAGE.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "thermalvision") 
            end 
        end 
    end 
end 
bindKey("n","down",playerZoom) 
bindKey("i","up",playerZoom) 

Edited by Guest
Link to comment

Tente:

function playerZoom (key,keyState) 
screenW, screenH = guiGetScreenSize() 
    if (key == "n") then 
        if (getElementData(getLocalPlayer(),"Night Vision Goggles") > 0) then 
            if nightvision then 
                nightvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
                removeEventHandler("onClientRender", root, image) 
            else 
                nightvision = true 
                addEventHandler("onClientRender", root, image) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "nightvision") 
            end 
        end 
    elseif (key == "i") then 
        if (getElementData(getLocalPlayer(),"Infrared Goggles") > 0) then 
            if infaredvision then 
                infaredvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
                removeEventHandler("onClientRender", root, image) 
            else 
                infaredvision = true 
                addEventHandler("onClientRender", root, image) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "thermalvision") 
            end 
        end 
    end 
end 
bindKey("n","down",playerZoom) 
bindKey("i","up",playerZoom) 
  
function image() 
    dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, "IMAGE.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
end 

Edited by Guest
Link to comment
Tente:
function playerZoom (key,keyState) 
local screenW, screenH = guiGetScreenSize() 
    if (key == "n") then 
        if (getElementData(getLocalPlayer(),"Night Vision Goggles") > 0) then 
            if nightvision then 
                nightvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
                removeEventHandler("onClientRender", root, image) 
            else 
                nightvision = true 
                addEventHandler("onClientRender", root, image) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "nightvision") 
            end 
        end 
    elseif (key == "i") then 
        if (getElementData(getLocalPlayer(),"Infrared Goggles") > 0) then 
            if infaredvision then 
                infaredvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
                removeEventHandler("onClientRender", root, image) 
            else 
                infaredvision = true 
                addEventHandler("onClientRender", root, image) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "thermalvision") 
            end 
        end 
    end 
end 
bindKey("n","down",playerZoom) 
bindKey("i","up",playerZoom) 
  
function image() 
    dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, "IMAGE.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
end 

Tentei, não aconteceu nada, ficou normal, não renderiza nenhuma imagem.

Link to comment
function playerZoom (key,keyState) 
local screenW, screenH = guiGetScreenSize() 
    if (key == "n") then 
        if (getElementData(getLocalPlayer(),"Night Vision Goggles") > 0) then 
            if nightvision then 
                nightvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
                removeEventHandler("onClientRender", root, image) 
            else 
                nightvision = true 
                addEventHandler("onClientRender", root, image) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "nightvision") 
            end 
        end 
    elseif (key == "i") then 
        if (getElementData(getLocalPlayer(),"Infrared Goggles") > 0) then 
            if infaredvision then 
                infaredvision = false 
                setPedAnimation(getLocalPlayer()) 
                setCameraGoggleEffect("normal") 
                removeEventHandler("onClientRender", root, image) 
            else 
                infaredvision = true 
                addEventHandler("onClientRender", root, image) 
                setTimer(setPedAnimation, 150, 1,getLocalPlayer(),"goggles","goggles_put_on",650,true,false,false,false) 
                setTimer(setCameraGoggleEffect, 700, 1, "thermalvision") 
            end 
        end 
    end 
end 
bindKey("n","down",playerZoom) 
bindKey("i","up",playerZoom) 
  
function image() 
    dxDrawImage(screenW *0, screenH *0, screenW *1, screenH * 1, "nightvision.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
end 

Edited by Guest
Link to comment

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...