Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-02-29, 13:04


Kacperiusz

.






Wiek: 23
Na forum: 2770 dni
Posty: 113

Piwa: 205

Respekt: 50

Witam.
Robi? skrypt na panel zmiany kolor?w aut w gui.
Problem polega na tym ?e nie wiem jak zrobi? by po drugim klikni?ciu przycisku "F3" gui znika?o.

Kod:

local swsh guiGetScreenSize() 
local zoom 1920/sw

marker createMarker(-2455.00879, -424.1396884.04877-1"cylinder"125500)

local t dxCreateTexture("tlo.png")
local t2 dxCreateTexture("pasek.png")

function mysz xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    
    return ( ( cx >= and cx <= width ) and ( cy >= and cy <= height ) )
end

function gui()
    dxDrawImage(sw/2-1540/zoomsh/2-800/zoom1920/zoom1080/zoomt)
    dxDrawImage(sw/2-1540/zoomsh/2-745/zoom1920/zoom1080/zoomt2000tocolor(25500))
    dxDrawText("Kup czerwone"310/zoom260/zoom83/zoom236/zoomtocolor(255255255), 2)

    
    --dxDrawImage(sw/2-400/zoomsh/2-600/zoom1920/zoom1080/zoomt2)
end

function myszka()
    showCursor(true)
end

function wywolaj()
    addEventHandler("onClientRender"rootgui)
    bindKey("F3""down"myszka)
end
addEventHandler("onClientMarkerHit"markerwywolaj)

addEventHandler("onClientClick"root, function(btnstate)
    local veh getPedOccupiedVehicle(localPlayer)
        if veh then 
            if btn == "left" and state == "down" then
            if mysz(sw/2-1540/zoomsh/2-800/zoom1920/zoom1080/zoom)then 
            setVehicleColor(veh25500)
            end
        end 
    end 
end


Prosz? o pomoc. Daje :piwo:


Podpis
pecik
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-02-29, 15:00


NotPaladyn







Wiek: 23
Na forum: 2790 dni
Posty: 866
Nick w MP: NotPaladyn

Piwa: 3135

Respekt: 690
Respekt: 690Respekt: 690


   Vice Admin: Jeśli potrzebujesz pomocy w sprawach organizacyjnych lub technicznych - skontaktuj się ze mną.
Spr?buj tak, nietestowane jak b?d? problemy to pisz


local swsh guiGetScreenSize() 
local zoom 1920/sw

marker createMarker(-2455.00879, -424.1396884.04877-1"cylinder"125500)

local t dxCreateTexture("tlo.png")
local t2 dxCreateTexture("pasek.png")

function mysz xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    
    return ( ( cx >= and cx <= width ) and ( cy >= and cy <= height ) )
end



function isEventHandlerAddedsEventNamepElementAttachedTofunc )
     if typesEventName ) == 'string' and isElementpElementAttachedTo ) and typefunc ) == 'function' then
          local aAttachedFunctions getEventHandlerssEventNamepElementAttachedTo )
          if typeaAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
               for iv in ipairsaAttachedFunctions ) do
                    if == func then
                     return true
                end
           end
      end
     end
     return false
end



function gui()
    dxDrawImage(sw/2-1540/zoomsh/2-800/zoom1920/zoom1080/zoomt)
    dxDrawImage(sw/2-1540/zoomsh/2-745/zoom1920/zoom1080/zoomt2000tocolor(25500))
    dxDrawText("Kup czerwone"310/zoom260/zoom83/zoom236/zoomtocolor(255255255), 2)

    
    --dxDrawImage(sw/2-400/zoomsh/2-600/zoom1920/zoom1080/zoomt2)
end


bindKey("F3""down", function()
if isElementWithinMarker(localPlayermarker) and not isEventHandlerAdded("onClientRender"rootguithen
addEventHandler("onClientRender"rootgui)
showCursor(true)
else
removeEventHandler("onClientRender"rootgui)
showCursor(false)
end
end)


addEventHandler("onClientClick"root, function(btnstate)
    local veh getPedOccupiedVehicle(localPlayer)
        if veh then 
            if btn == "left" and state == "down" then
            if mysz(sw/2-1540/zoomsh/2-800/zoom1920/zoom1080/zoom)then 
            setVehicleColor(veh25500)
            end
        end 
    end 
end)  


Postaw piwo autorowi tego posta
 

 
Tagi: bindkey.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » BindKey. Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku