Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: bindkey.
1. BindKey.
[center]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:
[lua]
local sw, sh = guiGetScreenSize()
local zoom = 1920/sw

marker = createMarker(-2455.00879, -424.13968, 84.04877-1, "cylinder", 1, 255, 0, 0)

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

function mysz ( 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

function gui()
dxDrawImage(sw/2-1540/zoom, sh/2-800/zoom, 1920/zoom, 1080/zoom, t)
dxDrawImage(sw/2-1540/zoom, sh/2-745/zoom, 1920/zoom, 1080/zoom, t2, 0, 0, 0, tocolor(255, 0, 0))
dxDrawText("Kup czerwone", 310/zoom, 260/zoom, 83/zoom, 236/zoom, tocolor(255, 255, 255), 2)


--dxDrawImage(sw/2-400/zoom, sh/2-600/zoom, 1920/zoom, 1080/zoom, t2)
end

function myszka()
showCursor(true)
end

function wywolaj()
addEventHandler("onClientRender", root, gui)
bindKey("F3", "down", myszka)
end
addEventHandler("onClientMarkerHit", marker, wywolaj)

addEventHandler("onClientClick", root, function(btn, state)
local veh = getPedOccupiedVehicle(loca...