--[[ @autor: Nbi#1824 @dla: City LifeRPG @zasob: Salon pojazdów ]] local blip = createBlip(559.615, -1308.150, 17.256,55) setBlipVisibleDistance(blip,200) local sx, sy = guiGetScreenSize() local px, py = (sx/1920),(sy/1080) function cursorPos(psx,psy,pssx,pssy,abx,aby) if not isCursorShowing() then return end cx,cy=getCursorPosition() sx, sy = guiGetScreenSize() 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 --- [[ZMIENNE]] ds_guishow = false strona_startowa = true sportowe = false offroady = false muscle = false zwykle = false car_offroad = 0 car_sport = 0 car_muscle = 0 car_zwykle = 0 buy_cooldown = false czas = 0 function clear_cooldown() if not buy_cooldown then buy_cooldown = true end setTimer(function() buy_cooldown = false end,3000,1) end -- [[MARKER]] open_marker = createMarker(540.434, -1309.891, 17.256-1,"cylinder",1.5,0,138,255) setElementData(open_marker,"marker:text","Salon pojazdów\n\fNaciśnij E, aby otworzyć GUI\f") setElementData(open_marker,"icon","myjnia") function open_gui() if not isElementWithinMarker(localPlayer,open_marker) then return end if isPedInVehicle(localPlayer) then return end if ds_guishow then return end setElementFrozen(localPlayer,true) ds_guishow = true tick = getTickCount() addEventHandler("onClientRender",root,gui_cd) showCursor(true) showChat(false) setPlayerHudComponentVisible("radar", false) end bindKey("E","down",open_gui) function close_gui() --if not isElementWithinMarker(localPlayer,open_marker) then return end if not ds_guishow then return end if sportowe then removeEventHandler("onClientRender",root,sport_cd) elseif offroady then removeEventHandler("onClientRender",root,offroad_cd) elseif muscle then removeEventHandler("onClientRender",root,muscle_cd) elseif zwykle then removeEventHandler("onClientRender",root,zwykle_cd) else removeEventHandler("onClientRender",root,gui_cd) end ds_guishow = false setElementFrozen(localPlayer,false) showCursor(false) strona_startowa = true showChat(true) tick = getTickCount() setPlayerHudComponentVisible("radar", true) end bindKey("Backspace","down",close_gui) local grafiki = { [1] = dxCreateTexture("img/dealer.png"), [2] = dxCreateTexture("img/vehicle.png"), [3] = dxCreateTexture("img/sport.png"), [4] = dxCreateTexture("img/offroad.png"), [5] = dxCreateTexture("img/lowrider.png"), [6] = dxCreateTexture("img/motor.png"), [7] = dxCreateTexture("img/l_arrow.png"), [8] = dxCreateTexture("img/r_arrow.png"), [9] = dxCreateTexture("img/b_pasek.png"), [10] = dxCreateTexture("img/n_pasek.png"), [11] = dxCreateTexture("img/button.png"), } local auta_sport = { [1] = dxCreateTexture("cars/infek.png"), [2] = dxCreateTexture("cars/bullet.png"), [3] = dxCreateTexture("cars/cheetah.png"), [4] = dxCreateTexture("cars/sgt.png"), [5] = dxCreateTexture("cars/jester.png"), [6] = dxCreateTexture("cars/elegy.png"), [7] = dxCreateTexture("cars/bwmm4.png"), [8] = dxCreateTexture("cars/rocketbunny.png"), } local auta_offroad = { [1] = dxCreateTexture("cars/sandking.png"), [2] = dxCreateTexture("cars/huntley.png"), [3] = dxCreateTexture("cars/rancher.png"), [4] = dxCreateTexture("cars/yosemite.png"), [5] = dxCreateTexture("cars/audiq8.png"), [6] = dxCreateTexture("cars/gklasa.png"), [7] = dxCreateTexture("cars/raptor.png"), } local auta_muscle = { [1] = dxCreateTexture("cars/sabre.png"), [2] = dxCreateTexture("cars/buffalo.png"), [3] = dxCreateTexture("cars/phoenix.png"), [4] = dxCreateTexture("cars/clover.png"), } local auta_zwykle = { [1] = dxCreateTexture("cars/w140.png"), [2] = dxCreateTexture("cars/sentinel.png"), [3] = dxCreateTexture("cars/manana.png"), [4] = dxCreateTexture("cars/perek.png"), [5] = dxCreateTexture("cars/sadler.png"), } local font = { [1] = dxCreateFont("font/bold.ttf",14), [2] = dxCreateFont("font/bold.ttf",25), [3] = dxCreateFont("font/aquire.ttf",18), [4] = dxCreateFont("font/aquire.ttf",10), [5] = dxCreateFont("font/aquire.ttf",11), [6] = dxCreateFont("font/aquire.ttf",6), [7] = dxCreateFont("font/aquire.ttf",8), } local text = { {"Salon Pojazdów"}, {"Sportowe"}, {"Offroad'owe"}, {"Zwykle"}, {"Muscle"}, {"Aby zamknac GUI, kliknij #008affBackspace!#ffffff"}, {"Informacje o pojezdzie"}, {"#008affStatystyki#ffffff"}, {"Pojazdy sportowe"}, -- 9 {"Wybrany pojazd: #008aff"}, {"Poprzednie"}, {"Nastepne"}, {"Cena "}, {"Predkosc maksymalna"}, {"Sila hamowania"}, {"Sterownosc"}, {"Powrot"}, {"Pojazdy offroad'owe"}, {"Muscle Cary"}, {"Pojazdy zwykle"}, -- 20 {"Kup"}, {"Jazda\ntestowa"}, } function gui_cd() alpha = interpolateBetween(0,0,0,255,0,0, (getTickCount()-tick)/500, "Linear") dxDrawText(text[6][1], 680*px,55*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) if strona_startowa then dxDrawImage(480*px,270*py,960*px,540*py, grafiki[1],0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[1][1], 680*px,-825*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[3], "center", "center", false, true, true, true, false) --sportowe if cursorPos(747*px,408*py,190*px,130*py) then dxDrawImage(745*px,405*py,195*px,135*py, grafiki[3]) dxDrawText(text[2][1], 375*px,-560*py,950*px,1500*py, tocolor(0,138,255), 1 * px, font[5], "center", "center", false, true, true, true, false) else dxDrawImage(747*px,408*py,190*px,130*py, grafiki[3]) dxDrawText(text[2][1], 375*px,-560*py,950*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) end --offroady if cursorPos(976*px,412*py,187*px,128*py) then dxDrawImage(974*px,409*py,192*px,133*py, grafiki[4]) dxDrawText(text[3][1], 1275*px,-560*py,1270*px,1500*py, tocolor(0,138,255), 1 * px, font[5], "center", "center", false, true, true, true, false) else dxDrawImage(976*px,412*py,187*px,128*py, grafiki[4]) dxDrawText(text[3][1], 1275*px,-560*py,1270*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) end --zwykle if cursorPos(976*px,592*py,187*px,128*py) then dxDrawImage(974*px,589*py,192*px,134*py, grafiki[5]) dxDrawText(text[4][1], 1275*px,-200*py,1270*px,1500*py, tocolor(0,138,255), 1 * px, font[5], "center", "center", false, true, true, true, false) else dxDrawImage(976*px,592*py,187*px,128*py, grafiki[5]) dxDrawText(text[4][1], 1275*px,-200*py,1270*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) end --muscle if cursorPos(747*px,592*py,190*px,128*py) then dxDrawImage(745*px,589*py,195*px,133*py, grafiki[6]) dxDrawText(text[5][1], 375*px,-200*py,950*px,1500*py, tocolor(0,138,255), 1 * px, font[5], "center", "center", false, true, true, true, false) else dxDrawImage(747*px,592*py,190*px,128*py, grafiki[6]) dxDrawText(text[5][1], 375*px,-200*py,950*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) end end end --[[ZWYKLE]] function zwykle_cd() if not zwykle_cd then return end if car_zwykle == 1 then id = 547 model = "Mercedes S W140" grafika = auta_zwykle[1] cena = "42500" vmax = 44 brake = 39 steering = 55 elseif car_zwykle == 2 then id = 405 model = "Sentinel" grafika = auta_zwykle[2] cena = "38500" vmax = 52 brake = 44 steering = 38 elseif car_zwykle == 3 then id = 410 model = "Manana" grafika = auta_zwykle[3] cena = "4700" vmax = 23 brake = 33 steering = 38 elseif car_zwykle == 4 then id = 404 model = "Perennial" grafika = auta_zwykle[4] cena = "5000" vmax = 19 brake = 29 steering = 35 if car_zwykle == 1 then id = 605 model = "Sadler" grafika = auta_zwykle[1] cena = "4500" vmax = 48 brake = 39 steering = 55 end alpha = interpolateBetween(0,0,0,255,0,0, (getTickCount()-tick)/200, "Linear") dxDrawImage(480*px,270*py,960*px,540*py, grafiki[2],0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[7][1], 680*px,-825*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[3], "center", "center", false, true, true, true, false) dxDrawText(text[8][1], 375*px,-675*py,920*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[20][1], 875*px,-675*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[6][1], 680*px,55*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) if cursorPos(665*px,700*py,120*px,60*py) then dxDrawImage(663*px,700*py,122*px,62*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(665*px,700*py,120*px,60*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(525*px,700*py,120*px,60*py) then dxDrawImage(523*px,700*py,122*px,62*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(525*px,700*py,120*px,60*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(800*px,650*py,150*px,120*py) then -- poprzednie dxDrawText(text[11][1], 485*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(798*px,648*py,152*px,122*py, grafiki[7]) else dxDrawText(text[11][1], 485*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(800*px,650*py,150*px,120*py, grafiki[7]) end if cursorPos(1250*px,650*py,150*px,120*py) then -- nastpene dxDrawImage(1248*px,648*py,152*px,122*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(1250*px,650*py,150*px,120*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end dxDrawImage(960*px,520*py,220*px,170*py, grafika,0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[10][1].. " "..model.."#ffffff", 880*px,-550*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawText(text[13][1].." $" ..przecinek(cena), 580*px,-550*py,1020*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "left", "center", false, true, true, true, false) --PRZYCISK POWROTU if cursorPos(1035*px,685*py,120*px,60*py) then dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,683*py,122*px,62*py, grafiki[11]) else dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,685*py,120*px,60*py, grafiki[11]) end --[[STATYSTYKI]] --vmax dxDrawText(text[14][1], 240*px,-380*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,570*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,570*py,200*px * (vmax/100),10*py, grafiki[10]) --sila hamowania dxDrawText(text[15][1], 240*px,-280*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,620*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,620*py,200*px * (brake/100),10*py, grafiki[10]) --skretnosc dxDrawText(text[16][1], 240*px,-180*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,670*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,670*py,200*px * (steering/100),10*py, grafiki[10]) end addEventHandler("onClientClick", root, function(btn,state) -- wejscie do kat zwyklej if btn=="left" and state=="down" and ds_guishow then if cursorPos(976*px,592*py,187*px,128*py) and strona_startowa then zwykle = true strona_startowa = false car_zwykle = 1 removeEventHandler("onClientRender",root,gui_cd) addEventHandler("onClientRender",root,zwykle_cd) end end end) addEventHandler("onClientClick", root, function(btn,state) -- Przyciski w kat zwyklej if btn=="left" and state=="down" and ds_guishow then if cursorPos(1250*px,650*py,150*px,120*py) and zwykle then if car_zwykle == 4 then car_zwykle = 1 return end car_zwykle = car_zwykle + 1 elseif cursorPos(800*px,650*py,150*px,120*py) then if car_zwykle == 1 then car_zwykle = 4 return end car_zwykle = car_zwykle - 1 end end end) addEventHandler("onClientClick", root, function(btn,state) -- kupowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(525*px,700*py,120*px,60*py) and zwykle then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end if getElementData(localPlayer,"player:money") < tonumber(cena) then exports["cl-noti"]:noti("Nie masz tyle pieniędzy!","error") return end --outputChatBox("[#008affINFORMACJA#ffffff] Zakupiłeś: #008aff"..model.."#ffffff za cene: #008aff$"..przecinek(cena).."#ffffff",255,255,255,true) exports["cl-noti"]:noti("Zakupiłeś pojazd marki: "..model.."($"..tonumber(cena)..")","success") local sid = getElementData(localPlayer,"player:sid") triggerServerEvent("buy:car",localPlayer,id,sid,cena) clear_cooldown() end end end) addEventHandler("onClientClick", root, function(btn,state) -- testowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(665*px,700*py,120*px,60*py) and zwykle then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end if getElementData(localPlayer,"player:money") < 500 then exports["cl-noti"]:noti("Masz za mało pięniedzy! Koszt jazdy testowej: $500","error") return end triggerServerEvent("test:car",localPlayer,localPlayer,id) czas = 30 if sportowe then removeEventHandler("onClientRender",root,sport_cd) elseif offroady then removeEventHandler("onClientRender",root,offroad_cd) elseif muscle then removeEventHandler("onClientRender",root,muscle_cd) elseif zwykle then removeEventHandler("onClientRender",root,zwykle_cd) else removeEventHandler("onClientRender",root,gui_cd) end addEventHandler("onClientRender",root,test_gui) odlicz_czas() showChat(true) showCursor(false) ds_guishow = false setElementFrozen(localPlayer,false) strona_startowa = true clear_cooldown() setPlayerHudComponentVisible("radar", true) end end end) function odlicz_czas() tajmer = setTimer(function() if czas == 0 or czas < 0 then kill_tajmer() triggerServerEvent("del:test:car",localPlayer,localPlayer) setTimer( setElementPosition, 1500, 1, localPlayer, 30.58, 1529.82, 12.77+0.1) removeEventHandler("onClientRender",root,test_gui) return end czas = czas - 1 end,1000,0) end function kill_tajmer() killTimer(tajmer) end function test_gui() if czas > 0 then dxDrawText("Pozostały czas jazdy testowej: (#008aff"..czas.."#ffffff)", 300*px, 1585*py, 1640*px, 477*py, tocolor(255,255,255, 255), 1*px, font[2], "right", "center", false, false, false, true) end end --[[^^^^^^]] --[[MUSCLE]] function muscle_cd() if not muscle then return end if car_muscle == 1 then id = 475 model = "Sabre" grafika = auta_muscle[1] cena = "90000" vmax = 89 brake = 44 steering = 39 elseif car_muscle == 2 then id = 402 model = "Buffalo" grafika = auta_muscle[2] cena = "120000" vmax = 78 brake = 42 steering = 44 elseif car_muscle == 3 then id = 603 model = "Phoenix" grafika = auta_muscle[3] cena = "105000" vmax = 94 brake = 33 steering = 38 elseif car_muscle == 4 then id = 542 model = "Clover" grafika = auta_muscle[4] cena = "75000" vmax = 64 brake = 41 steering = 44 end alpha = interpolateBetween(0,0,0,255,0,0, (getTickCount()-tick)/200, "Linear") dxDrawImage(480*px,270*py,960*px,540*py, grafiki[2],0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[7][1], 680*px,-825*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[3], "center", "center", false, true, true, true, false) dxDrawText(text[8][1], 375*px,-675*py,920*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[19][1], 875*px,-675*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[6][1], 680*px,55*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) if cursorPos(665*px,700*py,120*px,60*py) then dxDrawImage(663*px,700*py,122*px,62*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(665*px,700*py,120*px,60*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(525*px,700*py,120*px,60*py) then dxDrawImage(523*px,700*py,122*px,62*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(525*px,700*py,120*px,60*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(800*px,650*py,150*px,120*py) then -- poprzednie dxDrawText(text[11][1], 485*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(798*px,648*py,152*px,122*py, grafiki[7]) else dxDrawText(text[11][1], 485*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(800*px,650*py,150*px,120*py, grafiki[7]) end if cursorPos(1250*px,650*py,150*px,120*py) then -- nastpene dxDrawImage(1248*px,648*py,152*px,122*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(1250*px,650*py,150*px,120*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end dxDrawImage(960*px,520*py,220*px,170*py, grafika,0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[10][1].. " "..model.."#ffffff", 880*px,-550*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawText(text[13][1].." $" ..przecinek(cena), 580*px,-550*py,1020*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "left", "center", false, true, true, true, false) --PRZYCISK POWROTU if cursorPos(1035*px,685*py,120*px,60*py) then dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,683*py,122*px,62*py, grafiki[11]) else dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,685*py,120*px,60*py, grafiki[11]) end --[[STATYSTYKI]] --vmax dxDrawText(text[14][1], 240*px,-380*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,570*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,570*py,200*px * (vmax/100),10*py, grafiki[10]) --sila hamowania dxDrawText(text[15][1], 240*px,-280*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,620*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,620*py,200*px * (brake/100),10*py, grafiki[10]) --skretnosc dxDrawText(text[16][1], 240*px,-180*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,670*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,670*py,200*px * (steering/100),10*py, grafiki[10]) end addEventHandler("onClientClick", root, function(btn,state) -- wejscie do kat muscle if btn=="left" and state=="down" and ds_guishow then if cursorPos(747*px,592*py,190*px,128*py) and strona_startowa then muscle = true strona_startowa = false car_muscle = 1 removeEventHandler("onClientRender",root,gui_cd) addEventHandler("onClientRender",root,muscle_cd) end end end) addEventHandler("onClientClick", root, function(btn,state) -- Przyciski w kat muscle if btn=="left" and state=="down" and ds_guishow then if cursorPos(1250*px,650*py,150*px,120*py) and muscle then if car_muscle == 4 then car_muscle = 1 return end car_muscle = car_muscle + 1 elseif cursorPos(800*px,650*py,150*px,120*py) then if car_muscle == 1 then car_muscle = 4 return end car_muscle = car_muscle - 1 end end end) addEventHandler("onClientClick", root, function(btn,state) -- kupowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(525*px,700*py,120*px,60*py) and muscle then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end if getElementData(localPlayer,"player:money") < tonumber(cena) then exports["cl-noti"]:noti("Nie masz tyle pieniędzy!","error") return end --outputChatBox("[#008affINFORMACJA#ffffff] Zakupiłeś: #008aff"..model.."#ffffff za cene: #008aff$"..przecinek(cena).."#ffffff",255,255,255,true) exports["cl-noti"]:noti("Zakupiłeś pojazd marki: "..model.."($"..tonumber(cena)..")","success") local sid = getElementData(localPlayer,"player:sid") triggerServerEvent("buy:car",localPlayer,id,sid,cena) clear_cooldown() end end end) addEventHandler("onClientClick", root, function(btn,state) -- testowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(665*px,700*py,120*px,60*py) and muscle then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end clear_cooldown() if getElementData(localPlayer,"player:money") < 500 then exports["cl-noti"]:noti("Masz za mało pięniedzy! Koszt jazdy testowej: $500","error") return end triggerServerEvent("test:car",localPlayer,localPlayer,id) czas = 30 if sportowe then removeEventHandler("onClientRender",root,sport_cd) elseif offroady then removeEventHandler("onClientRender",root,offroad_cd) elseif muscle then removeEventHandler("onClientRender",root,muscle_cd) elseif zwykle then removeEventHandler("onClientRender",root,zwykle_cd) else removeEventHandler("onClientRender",root,gui_cd) end addEventHandler("onClientRender",root,test_gui) odlicz_czas() showChat(true) showCursor(false) ds_guishow = false setElementFrozen(localPlayer,false) strona_startowa = true setPlayerHudComponentVisible("radar", true) end end end) --[[^^^^^^]] --[[OFFROADY]] function offroad_cd() if not offroady then return end if car_offroad == 1 then id = 495 model = "Sandking" grafika = auta_offroad[1] cena = "230000" vmax = 62 brake = 51 steering = 47 elseif car_offroad == 2 then id = 579 model = "Huntley" grafika = auta_offroad[2] cena = "170000" vmax = 61 brake = 54 steering = 61 elseif car_offroad == 3 then id = 579 model = "Rancher" grafika = auta_offroad[3] cena = "127000" vmax = 59 brake = 58 steering = 42 elseif car_offroad == 4 then id = 554 model = "Yosemite" grafika = auta_offroad[4] cena = "110000" vmax = 47 brake = 35 steering = 31 elseif car_offroad == 5 then id = 400 model = "Mercedes Benz G65 AMG" grafika = auta_offroad[6] cena = "220000" vmax = 78 brake = 67 steering = 54 elseif car_offroad == 6 then id = 505 model = "Ford F-150 Raptor" grafika = auta_offroad[7] cena = "220000" vmax = 88 brake = 83 steering = 87 end alpha = interpolateBetween(0,0,0,255,0,0, (getTickCount()-tick)/200, "Linear") dxDrawImage(480*px,270*py,960*px,540*py, grafiki[2],0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[7][1], 680*px,-825*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[3], "center", "center", false, true, true, true, false) dxDrawText(text[8][1], 375*px,-675*py,920*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[18][1], 875*px,-675*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[6][1], 680*px,55*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) if cursorPos(665*px,700*py,120*px,60*py) then dxDrawImage(663*px,700*py,122*px,62*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(665*px,700*py,120*px,60*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(525*px,700*py,120*px,60*py) then dxDrawImage(523*px,700*py,122*px,62*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(525*px,700*py,120*px,60*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(800*px,650*py,150*px,120*py) then -- poprzednie dxDrawText(text[11][1], 485*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(798*px,648*py,152*px,122*py, grafiki[7]) else dxDrawText(text[11][1], 485*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(800*px,650*py,150*px,120*py, grafiki[7]) end if cursorPos(1250*px,650*py,150*px,120*py) then -- nastpene dxDrawImage(1248*px,648*py,152*px,122*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(1250*px,650*py,150*px,120*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end dxDrawImage(960*px,520*py,220*px,170*py, grafika,0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[10][1].. " "..model.."#ffffff", 880*px,-550*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawText(text[13][1].." $" ..przecinek(cena), 580*px,-550*py,1020*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "left", "center", false, true, true, true, false) --PRZYCISK POWROTU if cursorPos(1035*px,685*py,120*px,60*py) then dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,683*py,122*px,62*py, grafiki[11]) else dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,685*py,120*px,60*py, grafiki[11]) end --[[STATYSTYKI]] --vmax dxDrawText(text[14][1], 240*px,-380*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,570*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,570*py,200*px * (vmax/100),10*py, grafiki[10]) --sila hamowania dxDrawText(text[15][1], 240*px,-280*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,620*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,620*py,200*px * (brake/100),10*py, grafiki[10]) --skretnosc dxDrawText(text[16][1], 240*px,-180*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,670*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,670*py,200*px * (steering/100),10*py, grafiki[10]) end addEventHandler("onClientClick", root, function(btn,state) -- wejscie do kat offroad if btn=="left" and state=="down" and ds_guishow then if cursorPos(976*px,412*py,187*px,128*py) and strona_startowa then offroady = true strona_startowa = false car_offroad = 1 removeEventHandler("onClientRender",root,gui_cd) addEventHandler("onClientRender",root,offroad_cd) end end end) addEventHandler("onClientClick", root, function(btn,state) -- Przyciski w kat offroadowe if btn=="left" and state=="down" and ds_guishow then if cursorPos(1250*px,650*py,150*px,120*py) and offroady then if car_offroad == 7 then car_offroad = 1 return end car_offroad = car_offroad + 1 elseif cursorPos(800*px,650*py,150*px,120*py) then if car_offroad == 1 then car_offroad = 7 return end car_offroad = car_offroad - 1 end end end) addEventHandler("onClientClick", root, function(btn,state) -- kupowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(525*px,700*py,120*px,60*py) and offroady then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end if getElementData(localPlayer,"player:money") < tonumber(cena) then exports["cl-noti"]:noti("Nie masz tyle pieniędzy!","error") return end --outputChatBox("[#008affINFORMACJA#ffffff] Zakupiłeś: #008aff"..model.."#ffffff za cene: #008aff$"..przecinek(cena).."#ffffff",255,255,255,true) exports["cl-noti"]:noti("Zakupiłeś pojazd marki: "..model.."($"..tonumber(cena)..")","success") local sid = getElementData(localPlayer,"player:sid") triggerServerEvent("buy:car",localPlayer,id,sid,cena) clear_cooldown() end end end) addEventHandler("onClientClick", root, function(btn,state) -- testowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(665*px,700*py,120*px,60*py) and offroady then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end clear_cooldown() if getElementData(localPlayer,"player:money") < 500 then exports["cl-noti"]:noti("Masz za mało pięniedzy! Koszt jazdy testowej: $500","error") return end triggerServerEvent("test:car",localPlayer,localPlayer,id) czas = 30 if sportowe then removeEventHandler("onClientRender",root,sport_cd) elseif offroady then removeEventHandler("onClientRender",root,offroad_cd) elseif muscle then removeEventHandler("onClientRender",root,muscle_cd) elseif zwykle then removeEventHandler("onClientRender",root,zwykle_cd) else removeEventHandler("onClientRender",root,gui_cd) end addEventHandler("onClientRender",root,test_gui) odlicz_czas() showChat(true) showCursor(false) ds_guishow = false setElementFrozen(localPlayer,false) strona_startowa = true setPlayerHudComponentVisible("radar", true) end end end) --[[^^^^^^^^]] --[[SPORTOWE]] function sport_cd() if not sportowe then return end if car_sport == 1 then id = 411 model = "Infernus" grafika = auta_sport[1] cena = "1220000" vmax = 90 brake = 63 steering = 47 elseif car_sport == 2 then id = 541 model = "Bullet" grafika = auta_sport[2] cena = "950000" vmax = 70 brake = 50 steering = 56 elseif car_sport == 3 then id = 415 model = "Cheetah" grafika = auta_sport[3] cena = "680000" vmax = 87 brake = 67 steering = 43 elseif car_sport == 4 then id = 506 model = "SuperGT" grafika = auta_sport[4] cena = "475000" vmax = 76 brake = 55 steering = 47 elseif car_sport == 5 then id = 550 model = "Jester" grafika = auta_sport[5] cena = "375000" vmax = 71 brake = 53 steering = 44 elseif car_sport == 6 then id = 562 model = "Elegy" grafika = auta_sport[6] cena = "550000" vmax = 74 brake = 58 steering = 38 elseif car_sport == 7 then id = 491 model = "BMW M4 F82" grafika = auta_sport[7] cena = "610000" vmax = 99 brake = 93 steering = 89 elseif car_sport == 8 then id = 549 model = "Toyota GT86 Rocket Bunny" grafika = auta_sport[8] cena = "600000" vmax = 76 brake = 82 steering = 56 end alpha = interpolateBetween(0,0,0,255,0,0, (getTickCount()-tick)/200, "Linear") dxDrawImage(480*px,270*py,960*px,540*py, grafiki[2],0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[7][1], 680*px,-825*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[3], "center", "center", false, true, true, true, false) dxDrawText(text[8][1], 375*px,-675*py,920*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[9][1], 875*px,-675*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[4], "center", "center", false, true, true, true, false) dxDrawText(text[6][1], 680*px,55*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) if cursorPos(665*px,700*py,120*px,60*py) then dxDrawImage(663*px,700*py,122*px,62*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(665*px,700*py,120*px,60*py, grafiki[11]) -- jazda testowa dxDrawText(text[22][1], 300*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(525*px,700*py,120*px,60*py) then dxDrawImage(523*px,700*py,122*px,62*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(525*px,700*py,120*px,60*py, grafiki[11]) -- kupowanie dxDrawText(text[21][1], 25*px,-40*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end if cursorPos(800*px,650*py,150*px,120*py) then -- poprzednie dxDrawText(text[11][1], 485*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(798*px,648*py,152*px,122*py, grafiki[7]) else dxDrawText(text[11][1], 485*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(800*px,650*py,150*px,120*py, grafiki[7]) end if cursorPos(1250*px,650*py,150*px,120*py) then -- nastpene dxDrawImage(1248*px,648*py,152*px,122*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-84*py,1280*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) else dxDrawImage(1250*px,650*py,150*px,120*py, grafiki[8]) dxDrawText(text[12][1], 1345*px,-80*py,1280*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) end dxDrawImage(960*px,520*py,220*px,170*py, grafika,0,0,0,tocolor(255,255,255,alpha)) dxDrawText(text[10][1].. " "..model.."#ffffff", 880*px,-550*py,1220*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawText(text[13][1].." $" ..przecinek(cena), 580*px,-550*py,1020*px,1500*py, tocolor(255,255,255), 1 * px, font[7], "left", "center", false, true, true, true, false) --PRZYCISK POWROTU if cursorPos(1035*px,685*py,120*px,60*py) then dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(0,138,255), 1 * px, font[7], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,683*py,122*px,62*py, grafiki[11]) else dxDrawText(text[17][1], 1050*px,-74*py,1145*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(1035*px,685*py,120*px,60*py, grafiki[11]) end --[[STATYSTYKI]] --vmax dxDrawText(text[14][1], 240*px,-380*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,570*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,570*py,200*px * (vmax/100),10*py, grafiki[10]) --sila hamowania dxDrawText(text[15][1], 240*px,-280*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,620*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,620*py,200*px * (brake/100),10*py, grafiki[10]) --skretnosc dxDrawText(text[16][1], 240*px,-180*py,1080*px,1500*py, tocolor(255,255,255), 1 * px, font[6], "center", "center", false, true, true, true, false) dxDrawImage(560*px,670*py,200*px,10*py, grafiki[9]) dxDrawImage(560*px,670*py,200*px * (steering/100),10*py, grafiki[10]) end addEventHandler("onClientClick", root, function(btn,state) -- wejscie do kat sport if btn=="left" and state=="down" and ds_guishow then if cursorPos(747*px,408*py,190*px,130*py) and strona_startowa then sportowe = true strona_startowa = false car_sport = 1 removeEventHandler("onClientRender",root,gui_cd) addEventHandler("onClientRender",root,sport_cd) end end end) addEventHandler("onClientClick", root, function(btn,state) -- Przyciski w kat sportowej if btn=="left" and state=="down" and ds_guishow then if cursorPos(1250*px,650*py,150*px,120*py) and sportowe then if car_sport == 8 then car_sport = 1 return end car_sport = car_sport + 1 elseif cursorPos(800*px,650*py,150*px,120*py) then if car_sport == 1 then car_sport = 8 return end car_sport = car_sport - 1 end end end) addEventHandler("onClientClick", root, function(btn,state) -- kupowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(525*px,700*py,120*px,60*py) and sportowe then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end if getElementData(localPlayer,"player:money") < tonumber(cena) then exports["cl-noti"]:noti("Nie masz tyle pieniędzy!","error") return end --outputChatBox("[#008affINFORMACJA#ffffff] Zakupiłeś: #008aff"..model.."#ffffff za cene: #008aff$"..przecinek(cena).."#ffffff",255,255,255,true) exports["cl-noti"]:noti("Zakupiłeś pojazd marki: "..model.."($"..tonumber(cena)..")","success") local sid = getElementData(localPlayer,"player:sid") triggerServerEvent("buy:car",localPlayer,id,sid,cena) clear_cooldown() end end end) addEventHandler("onClientClick", root, function(btn,state) -- testowanie if btn=="left" and state=="down" and ds_guishow then if cursorPos(665*px,700*py,120*px,60*py) and sportowe then if buy_cooldown then exports["cl-noti"]:noti("Odczekaj chwile!","error") return end clear_cooldown() if getElementData(localPlayer,"player:money") < 500 then exports["cl-noti"]:noti("Masz za mało pięniedzy! Koszt jazdy testowej: $500","error") return end triggerServerEvent("test:car",localPlayer,localPlayer,id) czas = 30 if sportowe then removeEventHandler("onClientRender",root,sport_cd) elseif offroady then removeEventHandler("onClientRender",root,offroad_cd) elseif muscle then removeEventHandler("onClientRender",root,muscle_cd) elseif zwykle then removeEventHandler("onClientRender",root,zwykle_cd) else removeEventHandler("onClientRender",root,gui_cd) end addEventHandler("onClientRender",root,test_gui) odlicz_czas() showChat(true) showCursor(false) ds_guishow = false setElementFrozen(localPlayer,false) strona_startowa = true setPlayerHudComponentVisible("radar", true) end end end) --[[^^^^^^^^]] --[[POWROT]] addEventHandler("onClientClick", root, function(btn,state) -- powrot ogolny if btn=="left" and state=="down" and ds_guishow then if cursorPos(1035*px,685*py,120*px,60*py) and sportowe then sportowe = false car_sport = 1 strona_startowa = true addEventHandler("onClientRender",root,gui_cd) removeEventHandler("onClientRender",root,sport_cd) elseif cursorPos(1035*px,685*py,120*px,60*py) and offroady then offroady = false car_offroad = 1 strona_startowa = true addEventHandler("onClientRender",root,gui_cd) removeEventHandler("onClientRender",root,offroad_cd) elseif cursorPos(1035*px,685*py,120*px,60*py) and muscle then muscle = false car_muscle = 1 strona_startowa = true addEventHandler("onClientRender",root,gui_cd) removeEventHandler("onClientRender",root,muscle_cd) elseif cursorPos(1035*px,685*py,120*px,60*py) and zwykle then zwykle = false car_zwykle = 1 strona_startowa = true addEventHandler("onClientRender",root,gui_cd) removeEventHandler("onClientRender",root,zwykle_cd) end end end) --[[^^^^^^]] function przecinek(xd) local left,num,right = string.match(xd,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end addEventHandler("onClientResourceStop", resourceRoot, function() setElementFrozen(localPlayer,false) end,false,"high") end