Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sx,sy = guiGetScreenSize()
- local playerName = getPlayerName ( localPlayer )
- local ped = createPed(242, 2432.24609375, -2095.853515625, 13.546875)
- local sx,sy = guiGetScreenSize()
- PanelOption = {}
- PanelOption["ShowingPanel"] = false
- function onPedClick(button, state, absX, absY, wx, wy, wz, element)
- if element and getElementType(element) == "ped" and state=="down" and not PanelOption["ShowingPanel"] then
- local x, y, z = getElementPosition(getLocalPlayer())
- if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then
- PanelOption["ShowingPanel"] = true
- PanelOption["ShowedPanel"] = 1
- removeEventHandler("onClientRender", root, drawPanel)
- addEventHandler("onClientRender", root, drawPanel)
- end
- end
- end
- addEventHandler("onClientClick", getRootElement(), onPedClick)
- function drawPanel()
- if PanelOption["ShowedPanel"] == 1 and PanelOption["ShowingPanel"] then
- dxDrawRectangle ( sx/2-175, sy/2-200, sx/5, sy/2.5, tocolor ( 0, 0, 0, 230 ) )
- dxDrawRectangle ( sx/2-179, sy/2-205, sx/4.9, sy/2.445, tocolor ( 0, 0, 0, 155 ) )
- dxDrawText("Válaszd ki melyik járművet szeretnéd.", sx/2-160, sy/2-195, _, _, tocolor(255, 255, 255, 255), 1.5, 1.5, "clear-normal")
- dxDrawRectangle(sx/2-165, sy/2-160, 315, 40, tocolor(255, 255, 255, 150))
- dxDrawRectangle(sx/2-165, sy/2-125, 315, 8, tocolor(67, 158, 211, 255))
- dxDrawText("Jármű 1", sx/2-50, sy/2-160, _, _, tocolor(0, 0, 0, 255), 2, 2, "clear-normal")
- dxDrawRectangle(sx/2-165, sy/2-100, 315, 40, tocolor(255, 255, 255, 150))
- dxDrawRectangle(sx/2-165, sy/2-65, 315, 8, tocolor(67, 158, 211, 255))
- dxDrawText("Jármű 2", sx/2-50, sy/2-100, _, _, tocolor(0, 0, 0, 255), 2, 2, "clear-normal")
- dxDrawRectangle(sx/2-165, sy/2-40, 315, 40, tocolor(255, 255, 255, 150))
- dxDrawRectangle(sx/2-165, sy/2-5, 315, 8, tocolor(67, 158, 211, 255))
- dxDrawText("Mégse", sx/2-50, sy/2-40, _, _, tocolor(0, 0, 0, 255), 2, 2, "clear-normal")
- end
- end
- function clickFunction(button,state,x,y)
- if button == "left" and state == "down" then
- if PanelOption["ShowedPanel"] == 1 then
- if box(sx/2-165,sy/2-160,315,40,x,y) then
- PanelOption["ShowingPanel"] = false
- outputChatBox("mennyé be a markerbe!")
- car1 = createMarker(2438.1162109375, -2096.0439453125, 12.546875, "cylinder", 1)
- removeEventHandler("onClientRender", root, drawPanel)
- end
- addEventHandler("onClientMarkerHit", root,
- function ()
- if isElementWithinMarker(localPlayer, car1) then
- outputChatBox("asdasd")
- triggerServerEvent ( "giveVehicle", localPlayer, localPlayer )
- destroyElement(car1)
- boxPickUp = createMarker(2459.8974609375, -2114.5537109375, 12.546875, "cylinder", 1)
- elseif isElementWithinMarker(localPlayer, boxPickUp) then
- outputChatBox("belemnté")
- triggerServerEvent( "objectMoves", localPlayer, localPlayer )
- end
- end)
- elseif box(sx/2-165,sy/2-100, 315, 40, x,y) then
- end
- elseif PanelOption["ShowedPanel"] == 2 then
- end
- end
- addEventHandler("onClientClick", root, clickFunction)
- function boxVehicleAdd(button, state, absX, absY, wx, wy, wz, element)
- if button == "left" and state == "down" then
- local x, y, z = getElementPosition(getLocalPlayer())
- if element and isElement(element) and getElementType(element) == "vehicle" and getElementModel(element) == 499 then
- if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then
- toggleControl("jump", false)
- triggerServerEvent("clickVehicle", localPlayer, localPlayer)
- end
- end
- end
- end
- addEventHandler("onClientClick", getRootElement(), boxVehicleAdd)
- function isInRectangle(x,y,w,h)
- if isCursorShowing() then
- local mx,my = getCursorPosition()
- local cursorx, cursory = mx*sx,my*sy
- if cursorx > x and cursorx < x + w and cursory > y and cursory < y+h then
- return true
- else
- return false
- end
- end
- end
- function box(dx, dy, dsz, dm, ex, ey)
- if (ex >= dx and ex <= dx + dsz and ey >= dy and ey <= dy + dm) then
- return true
- else
- return false
- end
- end
- local sx,sy = guiGetScreenSize()
- local playerName = getPlayerName ( localPlayer )
- local ped = createPed(242, 2432.24609375, -2095.853515625, 13.546875)
- local sx,sy = guiGetScreenSize()
- PanelOption = {}
- PanelOption["ShowingPanel"] = false
- function onPedClick(button, state, absX, absY, wx, wy, wz, element)
- if element and getElementType(element) == "ped" and state=="down" and not PanelOption["ShowingPanel"] then
- local x, y, z = getElementPosition(getLocalPlayer())
- if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then
- PanelOption["ShowingPanel"] = true
- PanelOption["ShowedPanel"] = 1
- removeEventHandler("onClientRender", root, drawPanel)
- addEventHandler("onClientRender", root, drawPanel)
- end
- end
- end
- addEventHandler("onClientClick", getRootElement(), onPedClick)
- function drawPanel()
- if PanelOption["ShowedPanel"] == 1 and PanelOption["ShowingPanel"] then
- dxDrawRectangle ( sx/2-175, sy/2-200, sx/5, sy/2.5, tocolor ( 0, 0, 0, 230 ) )
- dxDrawRectangle ( sx/2-179, sy/2-205, sx/4.9, sy/2.445, tocolor ( 0, 0, 0, 155 ) )
- dxDrawText("Válaszd ki melyik járművet szeretnéd.", sx/2-160, sy/2-195, _, _, tocolor(255, 255, 255, 255), 1.5, 1.5, "clear-normal")
- dxDrawRectangle(sx/2-165, sy/2-160, 315, 40, tocolor(255, 255, 255, 150))
- dxDrawRectangle(sx/2-165, sy/2-125, 315, 8, tocolor(67, 158, 211, 255))
- dxDrawText("Jármű 1", sx/2-50, sy/2-160, _, _, tocolor(0, 0, 0, 255), 2, 2, "clear-normal")
- dxDrawRectangle(sx/2-165, sy/2-100, 315, 40, tocolor(255, 255, 255, 150))
- dxDrawRectangle(sx/2-165, sy/2-65, 315, 8, tocolor(67, 158, 211, 255))
- dxDrawText("Jármű 2", sx/2-50, sy/2-100, _, _, tocolor(0, 0, 0, 255), 2, 2, "clear-normal")
- dxDrawRectangle(sx/2-165, sy/2-40, 315, 40, tocolor(255, 255, 255, 150))
- dxDrawRectangle(sx/2-165, sy/2-5, 315, 8, tocolor(67, 158, 211, 255))
- dxDrawText("Mégse", sx/2-50, sy/2-40, _, _, tocolor(0, 0, 0, 255), 2, 2, "clear-normal")
- end
- end
- function clickFunction(button,state,x,y)
- if button == "left" and state == "down" then
- if PanelOption["ShowedPanel"] == 1 then
- if box(sx/2-165,sy/2-160,315,40,x,y) then
- PanelOption["ShowingPanel"] = false
- outputChatBox("mennyé be a markerbe!")
- car1 = createMarker(2438.1162109375, -2096.0439453125, 12.546875, "cylinder", 1)
- removeEventHandler("onClientRender", root, drawPanel)
- end
- addEventHandler("onClientMarkerHit", root,
- function ()
- if isElementWithinMarker(localPlayer, car1) then
- outputChatBox("asdasd")
- triggerServerEvent ( "giveVehicle", localPlayer, localPlayer )
- destroyElement(car1)
- boxPickUp = createMarker(2459.8974609375, -2114.5537109375, 12.546875, "cylinder", 1)
- elseif isElementWithinMarker(localPlayer, boxPickUp) then
- outputChatBox("belemnté")
- triggerServerEvent( "objectMoves", localPlayer, localPlayer )
- end
- end)
- elseif box(sx/2-165,sy/2-100, 315, 40, x,y) then
- end
- elseif PanelOption["ShowedPanel"] == 2 then
- end
- end
- addEventHandler("onClientClick", root, clickFunction)
- function boxVehicleAdd(button, state, absX, absY, wx, wy, wz, element)
- if button == "left" and state == "down" then
- local x, y, z = getElementPosition(getLocalPlayer())
- if element and isElement(element) and getElementType(element) == "vehicle" and getElementModel(element) == 499 then
- if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then
- toggleControl("jump", false)
- triggerServerEvent("clickVehicle", localPlayer, localPlayer)
- end
- end
- end
- end
- addEventHandler("onClientClick", getRootElement(), boxVehicleAdd)
- function isInRectangle(x,y,w,h)
- if isCursorShowing() then
- local mx,my = getCursorPosition()
- local cursorx, cursory = mx*sx,my*sy
- if cursorx > x and cursorx < x + w and cursory > y and cursory < y+h then
- return true
- else
- return false
- end
- end
- end
- function box(dx, dy, dsz, dm, ex, ey)
- if (ex >= dx and ex <= dx + dsz and ey >= dy and ey <= dy + dm) then
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement