local sW, sH = guiGetScreenSize()
local zoom = 1
local baseX = 1920
local minZoom = 2
if sW < baseX then
zoom = math.min(minZoom, baseX/sW)
end
local markerxd = createMarker(1476.60, -1717.14, 14.05,"cylinder",1,255,255,255)
function gui_tp()
dxDrawRectangle(769/zoom, 362/zoom, 454/zoom, 480/zoom, tocolor(0, 0, 0, 164), false)
dxDrawRectangle(769/zoom, 362/zoom, 125/zoom, 76/zoom, tocolor(255, 0, 0, 255), false)
dxDrawText("Przejd?", 769/zoom, 362/zoom, 894/zoom, 437/zoom, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, true, false, false)
dxDrawRectangle(1098/zoom, 362/zoom, 125/zoom, 76/zoom, tocolor(255, 0, 0, 255), false)
dxDrawText("Anuluj", 1098/zoom, 362/zoom, 1223/zoom, 437/zoom, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, true, false, false)
end
addEventHandler("onClientMarkerHit",markerxd, function(el,md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
addEventHandler("onClientRender",root,gui_tp)
showCursor(true)
end)
addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if cursorPosition(769/zoom, 362/zoom, 125/zoom, 76/zoom) then
removeEventHandler("onClientRender", root, gui_tp)
showCursor(false)
setElementPosition(localPlayer,1476.26, -1710.37, 14.05)
elseif cursorPosition(1098/zoom, 362/zoom, 125/zoom, 76/zoom) then
removeEventHandler("onClientRender", root, gui_tp)
showCursor(false)
end
end
end)
function cursorPosition(x, y, w, h)
if (not isCursorShowing()) then
return false
end
local mx, my = getCursorPosition()
local fullx, fully = guiGetScreenSize()
cursorx, cursory = mx*fullx, my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end