Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x,y=36.63,82.19 -- my width
- intro_step=math.random(0,850)
- local muzyka = false
- local tick2 = getTickCount()
- local sx,sy=guiGetScreenSize()
- local data={ showed=nil, button={}, info=nil, misc=nil, }
- local sw,sh = guiGetScreenSize()
- local zoom = 1
- if sw < 1920 then
- zoom = math.min(2, 1920 / sw)
- end
- function getCenter(x, y)
- x,y = x / zoom, y / zoom
- return (sw / 2) - (x / 2), (sh / 2) - (y / 2)
- end
- local sm = {}
- sm.moov = 0
- sm.object1,sm.object2 = nil,nil
- local function removeCamHandler()
- if(sm.moov == 1)then
- sm.moov = 0
- end
- end
- local function camRender2()
- if (sm.moov == 1) then
- local x1,y1,z1 = getElementPosition(sm.object1)
- local x2,y2,z2 = getElementPosition(sm.object2)
- setCameraMatrix(x1,y1,z1,x2,y2,z2)
- end
- end
- addEventHandler("onClientPreRender",root,camRender2)
- function smoothMoveCamera2(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
- if(sm.moov == 1)then return false end
- sm.object1 = createObject(1337,x1,y1,z1)
- sm.object2 = createObject(1337,x1t,y1t,z1t)
- setElementAlpha(sm.object1,0)
- setElementAlpha(sm.object2,0)
- setObjectScale(sm.object1,0.01)
- setObjectScale(sm.object2,0.01)
- moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
- moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
- sm.moov = 1
- setTimer(removeCamHandler,time,1)
- setTimer(destroyElement,time,1,sm.object1)
- setTimer(destroyElement,time,1,sm.object2)
- return true
- end
- function isMouseIn ( 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
- local dist = 200
- local angler = 0
- function getPointFromDistanceRotation(x, y, dist, angler)
- local a = math.rad(270 - angler)
- local dx = math.cos(a) * dist;
- local dy = math.sin(a) * dist;
- return x+dx, y+dy;
- end
- local texture_choose = dxCreateTexture('img/choosepanel.png','argb',true,'clamp')
- function renderZoneBox()
- local x_1, y_1 = getCenter(400,500)
- dxDrawImage(x_1, y_1, 400/zoom, 500/zoom, texture_choose, 0, 0, 0, tocolor(255, 255, 255, 255), false)
- smoothMoveCamera2(-1490.93, 926.77, 57.32, -1490.93, 926.77, 57.32, -2001.11, 926.00, 65.32, -2001.11, 926.00, 65.32, 45000)
- end
- function math.round(number, decimals, method)
- decimals = decimals or 0
- local factor = 10 ^ decimals
- if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
- else return tonumber(("%."..decimals.."f"):format(number)) end
- end
- function onClick(btn,state)
- if btn=="left" and state=="down" then
- local x_2, y_2 = getCenter(328,-122)
- local _, y_3 = getCenter(328,40)
- local _, y_4 = getCenter(328,200)
- local _, y_5 = getCenter(328,355)
- if isMouseIn(x_2, y_5, 328/zoom, 65/zoom) and data.showed then
- setElementData(localPlayer,"player:spawn",{-2673.64, -5.47, 6.13+0.1})
- closeZones()
- elseif isMouseIn(x_2, y_4, 328/zoom, 65/zoom) and data.showed then
- setElementData(localPlayer,"player:spawn",{2182.57, 1115.87, 12.65+0.1})
- closeZones()
- elseif isMouseIn(638, 318, 77, 16) and data.showed then
- setElementData(localPlayer,"player:spawn",{1012.77, -1441.49, 13.55+0.1})
- closeZones()
- elseif isMouseIn(x_2, y_2, 328/zoom, 65/zoom) and data.showed then
- setElementData(localPlayer,"player:spawn",{-2015.83, -97.76, 35.39+0.1})
- closeZones()
- elseif isMouseIn(x_2, y_3, 328/zoom, 65/zoom) and data.showed then
- local domek=getElementData(localPlayer,"player:house")
- if not domek then
- setElementData(localPlayer,"player:spawn",{-1915.49, 881.90, 35.41+0.1})
- outputChatBox("Nie posiadasz domku!")
- end
- closeZones()
- end
- end
- end
- function closeZones()
- showChat(true)
- showCursor(false)
- fadeCamera(false)
- setElementAlpha(localPlayer,255)
- stopSound(muzyka)
- showPlayerHudComponent("all",false)
- showPlayerHudComponent("radar",true)
- showPlayerHudComponent("crosshair",true)
- showPlayerHudComponent("weapon",false)
- showPlayerHudComponent("health",false)
- showPlayerHudComponent("breath",false)
- showPlayerHudComponent("ammo",true)
- data.showed=false
- local tick2 = getTickCount()
- triggerServerEvent("core:spawnPlayer", localPlayer)
- setTimer(triggerEvent, 250, 1, "gui:start", localPlayer)
- removeEventHandler("onClientRender", root, renderZoneBox)
- removeEventHandler("onClientPreRender",root,camRender2)
- blur = false
- end
- function showZones(misc)
- muzyka=misc
- data.showed=true
- showPlayerHudComponent("all",false)
- guiSetInputMode("no_binds_when_editing")
- local tick2 = getTickCount()
- addEventHandler("onClientRender", root, renderZoneBox)
- addEventHandler("onClientClick", root, onClick)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement