local marker1 = createMarker(378.57,-114.38,1001.49-1, "cylinder", 1.5, 35, 142, 35)
local sx,sy=guiGetScreenSize()
local data={ showed=nil, button={}, info=nil, misc=nil, }
setElementDimension(marker1, 5)
setElementInterior(marker1, 5)
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 draw()
local screenW, screenH = guiGetScreenSize()
dxDrawLine((screenW * 0.2328) - 1, (screenH * 0.2633) - 1, (screenW * 0.2328) - 1, screenH * 0.7367, tocolor(54, 254, 27, 222), 1, false)
dxDrawLine(screenW * 0.7680, (screenH * 0.2633) - 1, (screenW * 0.2328) - 1, (screenH * 0.2633) - 1, tocolor(54, 254, 27, 222), 1, false)
dxDrawLine((screenW * 0.2328) - 1, screenH * 0.7367, screenW * 0.7680, screenH * 0.7367, tocolor(54, 254, 27, 222), 1, false)
dxDrawLine(screenW * 0.7680, screenH * 0.7367, screenW * 0.7680, (screenH * 0.2633) - 1, tocolor(54, 254, 27, 222), 1, false)
dxDrawRectangle(screenW * 0.2328, screenH * 0.2633, screenW * 0.5352, screenH * 0.4733, tocolor(0, 0, 0, 222), false)
dxDrawLine(screenW * 0.4039, screenH * 0.2633, screenW * 0.4039, screenH * 0.7400, tocolor(54, 254, 27, 222), 1, false)
dxDrawText("Wymagania:", screenW * 0.2359, screenH * 0.2800, screenW * 0.4039, screenH * 0.3433, tocolor(255, 255, 255, 255), 1.20, "default", "center", "top", false, false, false, false, false)
dxDrawText("-0SRP", screenW * 0.2344, screenH * 0.3433, screenW * 0.4039, screenH * 0.4050, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("-Du?o wolnego czasu", screenW * 0.2336, screenH * 0.4050, screenW * 0.4039, screenH * 0.4750, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("-Wytrzyma?o?ci", screenW * 0.2344, screenH * 0.4750, screenW * 0.4039, screenH * 0.5267, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("-Przede wszystkim ch?ci do pracy", screenW * 0.2328, screenH * 0.5267, screenW * 0.4016, screenH * 0.5767, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawImage(screenW * 0.4781, screenH * 0.2783, screenW * 0.2203, screenH * 0.2317, "cos.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Praca kelnera", screenW * 0.4781, screenH * 0.5150, screenW * 0.6984, screenH * 0.5517, tocolor(255, 255, 255, 255), 1.20, "default", "center", "top", false, false, false, false, false)
dxDrawText("Praca polegaj?ca na podanie zam?wie? dla klientow.Chyba w nic w tym trudnego nie ma.Ale je?li jeste? ci??ko my?l?cy cz?owiek to wypad", screenW * 0.4141, screenH * 0.5667, screenW * 0.7641, screenH * 0.6633, tocolor(255, 255, 255, 255), 1.00, "default", "center", "top", false, true, false, false, false)
if not isMouseIn(screenW * 0.5125, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633) then dxDrawRectangle(screenW * 0.5125, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633, tocolor(54, 254, 27, 222), false)
else dxDrawRectangle(screenW * 0.5125, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633, tocolor(50, 244, 17, 212), false) end
dxDrawText("Rozpocznij", screenW * 0.5203, screenH * 0.6733, screenW * 0.6391, screenH * 0.7200, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
if not isMouseIn(screenW * 0.2500, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633)then dxDrawRectangle(screenW * 0.2500, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633, tocolor(54, 254, 27, 222), false)
else dxDrawRectangle(screenW * 0.2500, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633, tocolor(50, 244, 17, 212), false) end
dxDrawText("Zakoncz", screenW * 0.1000, screenH * 0.6733, screenW * 0.5300, screenH * 0.7200, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
end
addEventHandler("onClientMarkerHit", marker1, function(hitPlayer)
if (localPlayer == hitPlayer) then
addEventHandler("onClientRender", root, draw)
end
end)
addEventHandler ( "onClientMarkerLeave", marker1, function(leftPlayer)
if(localPlayer == leftPlayer) then
removeEventHandler("onClientRender", root, draw)
end
end)
addEventHandler("onClientClick", root, function(btn,state)
local screenW, screenH = guiGetScreenSize()
if btn=="left" and state=="down" then
if isMouseIn(screenW * 0.5125, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633) then
outputChatBox("Rozpocze?e?/a? prac?, udaj si? do kasy po zam?wienie", 255,255,255)
end
end
end)
addEventHandler("onClientClick", root, function(btn,state)
local screenW, screenH = guiGetScreenSize()
if btn=="left" and state=="down" then
if isMouseIn(screenW * 0.5125, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633) then
local marker2= createMarker(375.87,-118.80,1001.50-1, "cylinder", 1.5, 35, 142, 35)
setElementDimension(marker2, 5)
setElementInterior(marker2, 5)
addEventHandler("onClientMarkerHit", marker2, function(hitPlayer)
if (localPlayer == hitPlayer) then
local taca = createObject (2216, 0,0,0)
setElementDimension(taca, 5)
setElementInterior(taca, 5)
attachElements (taca,localPlayer, 0.2, 0.3, 0.4,-30,25, 80)
setPedAnimation(localPlayer, "CARRY", "crry_prtial", 20)
outputChatBox("We jeszcze raz bo kucharz rozwali? ?arcie, a i mo?esz te? odda? odrazu te 2 zam?wienie", 255,255,255)
markery= {
{369.40,-125.31,1001.49},
{369.20,-128.73,1001.50},
{369.20,-125.55,1001.49},
{369.20,-122.48,1001.49},
{378.13,-122.20,1001.49},
{378.13,-125.47,1001.49},
}
addEventHandler("onClientMarkerHit", marker2, function(hitPlayer)
if (localPlayer == hitPlayer) then
rd = math.random(1, #markery)
local markerss=createMarker(markery[rd][1], markery[rd][2], markery[rd][3], "checkpoint", 1, 255, 0, 0, 200)
setElementDimension(markerss, 5)
setElementInterior(markerss, 5)
addEventHandler("onClientMarkerHit", markerss, function(hitPlayer)
if (localPlayer == hitPlayer) then
outputChatBox("Za dostarczenie zam?wienia otrzymujesz 30,000 PLN", 255,255,255)
outputChatBox("Resztki zosta?y, oddaj spowrotem je a kucharz co? z nich zrobi", 255,255,255)
givePlayerMoney(30000)
destroyElement(markerss)
detachElements(taca)
end
end)
end
end)
end
end)
end
end
end)
addEventHandler("onClientClick", root, function(btn,state)
local screenW, screenH = guiGetScreenSize()
if btn=="left" and state=="down" then
if isMouseIn(screenW * 0.2500, screenH * 0.6633, screenW * 0.1344, screenH * 0.0633) then
removeEventHandler("onClientMarkerHit", markerss, function(hitPlayer)
removeEventHandler("onClientMarkerHit", marker2, function(hitPlayer)
end)
end)
end)
end
end
end)