x,y=36.63,82.19 -- my width
intro_step=math.random(0,850)
local screenW, screenH = guiGetScreenSize()
local sx,sy=guiGetScreenSize()
local data={ showed=nil, button={}, info=nil, misc=nil, }
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
function renderZoneBox()
dxDrawRectangle(sx*270/1025, sy*150/14769, sx*500/1025, sy*458/167, tocolor(254, 254, 254, 32), false)
if data.info then dxDrawText(data.info, sx*252/1024, sy*232/768, sx*800/1024, sy*255/768, tocolor(237, 0, 0, 255), 1.00, "default", "center", "center", false) end
--dxDrawLine(sx*0/1024, sy*199/768, sx*1022/1024, sy*200/768, tocolor(31, 111, 193, 255), 5, false)
--dxDrawLine(sx*0/1024, sy*509/768, sx*1022/1024, sy*510/768, tocolor(31, 111, 193, 255), 5, false)
--dxDrawText("Your Adventure RPG", sx*0/1024, sy*157/768, sx*1024/1024, sy*237/768, white, 2.00, "pricedown", "center", "center", false)
--if not isMouseIn(sx*10/1024, sy*48/768, sx*225/1024, sy*92/768) then dxDrawRectangle(sx*10/1024, sy*48/768, sx*225/1024, sy*92/768, tocolor(31, 222, 140, 170), false)
--else dxDrawRectangle(sx*10/1024, sy*48/768, sx*225/1024, sy*92/768, tocolor(220, 100, 0, 100), false) end
--if not isMouseIn(sx*10/1024, sy*192/768, sx*225/1024, sy*92/768) then dxDrawRectangle(sx*10/1024, sy*192/768, sx*225/1024, sy*92/768, tocolor(31, 222, 140, 170), false)
--else dxDrawRectangle(sx*10/1024, sy*192/768, sx*225/1024, sy*92/768, tocolor(220, 100, 0, 100), false) end
--if not isMouseIn(sx*10/1024, sy*336/768, sx*225/1024, sy*92/768) then dxDrawRectangle(sx*10/1024, sy*336/768, sx*225/1024, sy*92/768, tocolor(31, 222, 140, 170), false)
--else dxDrawRectangle(sx*10/1024, sy*336/768, sx*225/1024, sy*92/768, tocolor(220, 100, 0, 100), false) end
--if not isMouseIn(sx*10/1024, sy*480/768, sx*225/1024, sy*92/768) then dxDrawRectangle(sx*10/1024, sy*480/768, sx*225/1024, sy*92/768, tocolor(31, 222, 140, 170), false)
--else dxDrawRectangle(sx*10/1024, sy*480/768, sx*225/1024, sy*92/768, tocolor(220, 100, 0, 100), false) end
--if not isMouseIn(sx*10/1024, sy*624/768, sx*225/1024, sy*92/768) then dxDrawRectangle(sx*10/1024, sy*624/768, sx*225/1024, sy*92/768, tocolor(31, 222, 140, 170), false)
--else dxDrawRectangle(sx*10/1024, sy*624/768, sx*225/1024, sy*92/768, tocolor(220, 100, 0, 100), false) end
dxDrawText("Los Santos", screenW * 0.3164, screenH * 0.-200, screenW * 0.6953, screenH * 0.4194, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("San Fierro", screenW * 0.3164, screenH * 0.-110, screenW * 0.6953, screenH * 0.4903, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Las Venturas", screenW * 0.3164, screenH * 0.050, screenW * 0.6953, screenH * 0.4903, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("El Quebrados", screenW * 0.3164, screenH * 0.25, screenW * 0.6953, screenH * 0.4903, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Fort Carson", screenW * 0.3164, screenH * 0.26, screenW * 0.6953, screenH * 0.7056, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Baza organizacji", screenW * 0.3164, screenH * 0.5625, screenW * 0.6953, screenH * 0.6347, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Dom", screenW * 0.3164, screenH * 0.7625, screenW * 0.6953, screenH * 0.6347, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
--dxDrawImage(sx * 0.3118, sy * 0.0313, sx * 0.3838, sy * 0.1549, "logo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(sx * 0.3118, sy * 0.1813, sx * 0.3838, sy * 0.1549, "misc/text.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(638, 533, 387, 73, "misc/text2.png", AristatesYuvarlak, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(0, 0, 1920, 1080, "misc/drift.png", AristatesYuvarlak, 0, 0, tocolor(255, 255, 255, 255), false)
local zone1=math.sin(intro_step/500)*9000
local zone2=math.cos(intro_step/500)*9000
-- setCameraMatrix (2019.56, 1343.03, 14.00, zone1, zone2, 2)
--setCameraMatrix(zone1, zone2, 120, zone1, zone2, 120)
intro_step=intro_step-1.5
end
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then--FC
if isMouseIn(sx*10/1024, sy*198/768, sx*225/1024, sy*92/-768) and data.showed then
setElementData(localPlayer,"player:spawn",{1479.51, -1713.07, 14.05+0.1})
closeZones()
end
---- EL ----
if isMouseIn(screenW * 0.3164, screenH * 0.25, screenW * 0.6953, screenH * 0.4903) and data.showed then
setElementData(localPlayer,"player:spawn",{-1521.04,2642.03,55.84+0.1})
closeZones()
end
---- LV ----
if isMouseIn(screenW * 0.3164, screenH * 0.050, screenW * 0.6953, screenH * 0.4903) and data.showed then
setElementData(localPlayer,"player:spawn",{1881.96,2287.28,10.98+0.1})
closeZones()
end
---- LS ----
if isMouseIn(screenW * 0.3164, screenH * 0.-200, screenW * 0.6953, screenH * 0.4194) and data.showed then
setElementData(localPlayer,"player:spawn",{1477.59,-1714.39,14.05+0.1})
closeZones()
end
---- SF ----
if isMouseIn(screenW * 0.3164, screenH * 0.-110, screenW * 0.6953, screenH * 0.4903) and data.showed then
setElementData(localPlayer,"player:spawn",{-2052.63,458.01,35.17+0.1})
closeZones()
end
---- FC ----
if isMouseIn(screenW * 0.3164, screenH * 0.26, screenW * 0.6953, screenH * 0.7056) and data.showed then
setElementData(localPlayer,"player:spawn",{48.88,1207.18,18.94+0.1})
closeZones()
end
---- INNE ----
if isMouseIn(screenW * 0.3164, screenH * 0.7625, screenW * 0.6953, screenH * 0.6347) and data.showed then
local domek=getElementData(localPlayer,"player:house")
if not domek then
setElementData(localPlayer,"player:spawn",{-2052.63,458.01,35.17+0.1})
outputChatBox("Nie posiadasz domku!")
end
closeZones()
end
if isMouseIn(screenW * 0.3164, screenH * 0.5625, screenW * 0.6953, screenH * 0.6347) and data.showed then
local org=getElementData(localPlayer,"player:organization:spawn")
if not org then
setElementData(localPlayer,"player:spawn",{-2052.63,458.01,35.17+0.1})
outputChatBox("Nie posiadasz organizacji/Lub nie posiada ona spawnu!")
closeZones()
else
setTimer(outputChatBox,1500,1,"Pomy?lnie zrespi?e? si? w organizacji.")
setElementData(localPlayer,"player:spawn",{tonumber(org[1]),tonumber(org[2]),tonumber(org[3])})
closeZones()
end
end
end
end)
function closeZones()
showChat(true)
showCursor(false)
fadeCamera(false)
setElementAlpha(localPlayer,255)
stopSound(data.misc)
showPlayerHudComponent("all",false)
showPlayerHudComponent("radar",true)
showPlayerHudComponent("crosshair",true)
showPlayerHudComponent("weapon",false)
showPlayerHudComponent("health",false)
showPlayerHudComponent("breath",false)
showPlayerHudComponent("ammo",true)
data.showed=false
destroyElement(blurShader)
-- Usuwamy elementy
triggerServerEvent("core:spawnPlayer", localPlayer)
setTimer(triggerEvent, 250, 1, "gui:start", localPlayer)
removeEventHandler("onClientRender", root, renderZoneBox)
blur = false
end
function showZones(misc)
data.misc=misc
data.showed=true
showPlayerHudComponent("all",false)
guiSetInputMode("no_binds_when_editing")
addEventHandler("onClientRender", root, renderZoneBox)
end