Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- screenWidth, screenHeight = guiGetScreenSize()
- responsiveMultipler = 1
- function resp(_ARG_0_)
- return _ARG_0_ * responsiveMultipler
- end
- function respc(_ARG_0_)
- return math.ceil(_ARG_0_ * responsiveMultipler)
- end
- function reMap(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_)
- return (_ARG_0_ - _ARG_1_) * (_ARG_4_ - _ARG_3_) / (_ARG_2_ - _ARG_1_) + _ARG_3_
- end
- fontSizeMultipler = reMap(screenWidth, 1024, 1920, 0.7, 1)
- panelState = false
- menuWidth = respc(400)
- menuHeight = respc(600)
- menuPosX = respc(20)
- menuPosY = respc(120)
- rowHeight = respc(40)
- Roboto = false
- Roboto2 = false
- Roboto3 = false
- Roboto4 = false
- currentLevel = 1
- currentSubLevel = 1
- selectionLevel = 0
- selectedMenu = 1
- buyingInProgress = false
- vehicleElement = false
- originalUpgrade = 0
- neonState = false
- neonId = false
- originalDoor = false
- originalPaintjob = false
- originalHeadLight = false
- originalHandling = false
- editPlate = false
- originalPlate = false
- vehicleColor = {}
- vehicleLightColor = {}
- addEventHandler("onClientElementDataChange", getRootElement(), function(_ARG_0_)
- if _ARG_0_ == "vehicle.tuning.Turbo" then
- if isElement(_UPVALUE0_[source]) then
- destroyElement(_UPVALUE0_[source])
- end
- if getElementData(source, "vehicle.tuning.Turbo") == 5 and isElementStreamedIn(source) and _UPVALUE1_[getElementModel(source)] then
- _UPVALUE0_[source] = createObject(2052, 0, 0, 0)
- attachElements(_UPVALUE0_[source], source, unpack(_UPVALUE1_[getElementModel(source)]))
- setElementCollisionsEnabled(_UPVALUE0_[source], false)
- setElementPosition(source, getElementPosition(source))
- setElementPosition(source, getElementPosition(source))
- end
- end
- end)
- addEventHandler("onClientElementDestroy", getRootElement(), function()
- if isElement(_UPVALUE0_[source]) then
- destroyElement(_UPVALUE0_[source])
- end
- end)
- addEventHandler("onClientElementStreamOut", getRootElement(), function()
- if isElement(_UPVALUE0_[source]) then
- destroyElement(_UPVALUE0_[source])
- end
- end)
- addEventHandler("onClientElementStreamIn", getRootElement(), function()
- if isElement(_UPVALUE0_[source]) then
- destroyElement(_UPVALUE0_[source])
- end
- if getElementData(source, "vehicle.tuning.Turbo") == 5 and _UPVALUE1_[getElementModel(source)] then
- _UPVALUE0_[source] = createObject(2052, 0, 0, 0)
- attachElements(_UPVALUE0_[source], source, unpack(_UPVALUE1_[getElementModel(source)]))
- setElementCollisionsEnabled(_UPVALUE0_[source], false)
- setElementPosition(source, getElementPosition(source))
- setElementPosition(source, getElementPosition(source))
- end
- end)
- addEventHandler("onClientResourceStart", getRootElement(), function(_ARG_0_)
- if getResourceName(_ARG_0_) == "sas_hud" then
- responsiveMultipler = exports.sas_hud:getResponsiveMultipler()
- menuWidth = respc(400)
- menuHeight = respc(600)
- menuPosX = respc(20)
- menuPosY = respc(120)
- rowHeight = respc(40)
- elseif source == getResourceRootElement() then
- if getResourceFromName("sas_hud") and getResourceState((getResourceFromName("sas_hud"))) == "running" then
- responsiveMultipler = exports.sas_hud:getResponsiveMultipler()
- menuWidth = respc(400)
- menuHeight = respc(600)
- menuPosX = respc(20)
- menuPosY = respc(120)
- rowHeight = respc(40)
- end
- engineImportTXD(engineLoadTXD("files/block.txd"), 2052)
- engineReplaceModel(engineLoadDFF("files/block.dff"), 2052)
- for _FORV_7_, _FORV_8_ in pairs(getElementsByType("vehicle", getRootElement(), true)) do
- if getElementData(_FORV_8_, "vehicle.tuning.Turbo") == 5 and _UPVALUE0_[getElementModel(_FORV_8_)] then
- _UPVALUE1_[_FORV_8_] = createObject(2052, 0, 0, 0)
- attachElements(_UPVALUE1_[_FORV_8_], _FORV_8_, unpack(_UPVALUE0_[getElementModel(_FORV_8_)]))
- setElementCollisionsEnabled(_UPVALUE1_[_FORV_8_], false)
- setElementPosition(_FORV_8_, getElementPosition(_FORV_8_))
- setElementPosition(_FORV_8_, getElementPosition(_FORV_8_))
- end
- end
- end
- end)
- function createFonts()
- destroyFonts()
- Roboto = dxCreateFont("files/fonts/Roboto.ttf", 14 * fontSizeMultipler, false, "antialiased")
- Roboto2 = dxCreateFont("files/fonts/Roboto.ttf", 18 * fontSizeMultipler, false, "antialiased")
- Roboto3 = dxCreateFont("files/fonts/Roboto.ttf", 36 * fontSizeMultipler, false, "antialiased")
- Roboto4 = dxCreateFont("files/fonts/Roboto.ttf", 11 * fontSizeMultipler, false, "antialiased")
- end
- function destroyFonts()
- if isElement(Roboto) then
- destroyElement(Roboto)
- end
- if isElement(Roboto2) then
- destroyElement(Roboto2)
- end
- if isElement(Roboto3) then
- destroyElement(Roboto3)
- end
- if isElement(Roboto4) then
- destroyElement(Roboto4)
- end
- end
- addEvent("toggleTuning", true)
- addEventHandler("toggleTuning", getRootElement(), function(_ARG_0_, _ARG_1_)
- panelState = _ARG_0_
- showCursor(_ARG_0_)
- camRotation = 0
- camOffsetZ = 0
- _UPVALUE0_ = 1
- if panelState then
- vehicleElement = getPedOccupiedVehicle(localPlayer)
- if not vehicleElement then
- panelState = false
- return
- end
- createFonts()
- vehicleColor = {
- getVehicleColor(vehicleElement, true)
- }
- vehicleLightColor = {
- getVehicleHeadLightColor(vehicleElement)
- }
- exports.sas_hud:hideHUD()
- _UPVALUE1_ = {
- {
- getElementPosition(vehicleElement)
- }[1] + (0 + (5 - 0) * math.cos((math.rad({
- getElementRotation(vehicleElement)
- }[3]))) - (5 - 0) * math.sin((math.rad({
- getElementRotation(vehicleElement)
- }[3])))),
- {
- getElementPosition(vehicleElement)
- }[2] + (0 + (5 - 0) * math.sin((math.rad({
- getElementRotation(vehicleElement)
- }[3]))) + (5 - 0) * math.cos((math.rad({
- getElementRotation(vehicleElement)
- }[3])))),
- {
- getElementPosition(vehicleElement)
- }[3] + 2.5,
- {
- getElementPosition(vehicleElement)
- }[1],
- {
- getElementPosition(vehicleElement)
- }[2],
- {
- getElementPosition(vehicleElement)
- }[3]
- }
- _UPVALUE2_ = _UPVALUE1_
- _UPVALUE3_ = _UPVALUE2_
- _UPVALUE4_ = getElementData(localPlayer, "char.Money") or 0
- _UPVALUE5_ = getElementData(localPlayer, "acc.premiumPoints") or 0
- currentLevel = 1
- currentSubLevel = 1
- selectionLevel = 0
- selectedMenu = 1
- else
- destroyFonts()
- setCameraTarget(localPlayer)
- exports.sas_hud:showHUD()
- colorPicker = false
- end
- end)
- addEvent("updatePremiumPoints", true)
- addEventHandler("updatePremiumPoints", getRootElement(), function(_ARG_0_)
- _UPVALUE0_ = _ARG_0_
- setElementData(localPlayer, "acc.premiumPoints", _ARG_0_)
- end)
- addEventHandler("onClientElementDataChange", getRootElement(), function(_ARG_0_, _ARG_1_)
- if _ARG_0_ == "char.Money" and source == localPlayer then
- if (getElementData(localPlayer, _ARG_0_) or 0) < _UPVALUE0_ then
- _UPVALUE1_ = _UPVALUE0_ - (getElementData(localPlayer, _ARG_0_) or 0)
- _UPVALUE2_ = getTickCount()
- end
- _UPVALUE0_ = getElementData(localPlayer, _ARG_0_) or 0
- elseif _ARG_0_ == "acc.premiumPoints" and source == localPlayer then
- if (getElementData(localPlayer, _ARG_0_) or 0) < _UPVALUE3_ then
- _UPVALUE4_ = _UPVALUE3_ - (getElementData(localPlayer, _ARG_0_) or 0)
- _UPVALUE5_ = getTickCount()
- end
- _UPVALUE3_ = getElementData(localPlayer, _ARG_0_) or 0
- elseif _ARG_0_ == "loggedIn" and source == localPlayer then
- for _FORV_5_, _FORV_6_ in ipairs(getElementsByType("vehicle")) do
- for _FORV_11_, _FORV_12_ in pairs((split(getElementData(_FORV_6_, "vehicle.tuning.Optical") or "", ","))) do
- addVehicleUpgrade(_FORV_6_, _FORV_12_)
- end
- end
- end
- end)
- addEventHandler("onResourceStart", getResourceRootElement(), function()
- connection = exports.sas_database:getConnection()
- end)
- addEventHandler("onClientRender", getRootElement(), function()
- if panelState then
- if selectionLevel == 1 then
- elseif selectionLevel == 2 then
- end
- if selectionLevel == 1 then
- elseif selectionLevel == 2 then
- end
- _UPVALUE0_ = {}
- visibleCount = 0
- notVisibleCount = 0
- smallestVisible = 0
- for _FORV_6_ = 1, #tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu do
- if false then
- _UPVALUE0_[_FORV_6_] = true
- visibleCount = visibleCount + 1
- if smallestVisible == 0 then
- smallestVisible = _FORV_6_
- end
- else
- notVisibleCount = notVisibleCount + 1
- end
- end
- menuHeight = visibleCount * rowHeight
- dxDrawRectangle(0, 0, screenWidth, respc(100), tocolor(0, 0, 0, 160))
- dxDrawImage(respc(20), 0, respc(100), respc(100), "files/logo.png", 0, 0, 0, tocolor(255, 255, 255, 255))
- dxDrawText("#7cc576SeeMTA v3 #ffffff- Tuning", respc(130), respc(20), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto3, "left", "top", false, false, true, true, true)
- if _UPVALUE2_ + 3000 >= getTickCount() then
- dxDrawText("#7cc576K\195\169szp\195\169nz:#ffffff\n" .. thousandsStepper(_UPVALUE3_) .. " #7cc576$\t#d75959(-" .. thousandsStepper(_UPVALUE4_) .. " $)", screenWidth - respc(300), respc(3), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- else
- dxDrawText("#7cc576K\195\169szp\195\169nz:#ffffff\n" .. thousandsStepper(_UPVALUE3_) .. " #7cc576$", screenWidth - respc(300), respc(3), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- end
- if _UPVALUE5_ + 3000 >= getTickCount() then
- dxDrawText("#32b3efPr\195\169mium pont:#ffffff\n" .. thousandsStepper(_UPVALUE6_) .. " #32b3efPP\t#d75959(-" .. thousandsStepper(_UPVALUE7_) .. " PP)", screenWidth - respc(300), respc(50), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- else
- dxDrawText("#32b3efPr\195\169mium pont:#ffffff\n" .. thousandsStepper(_UPVALUE6_) .. " #32b3efPP", screenWidth - respc(300), respc(50), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- end
- dxDrawRectangle(0, screenHeight - respc(80), screenWidth, respc(80), tocolor(0, 0, 0, 160))
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu] then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType == "money" then
- dxDrawText("\195\129r: #7cc576" .. thousandsStepper(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price) .. " $", respc(10), screenHeight - respc(75), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto, "left", "top", false, false, true, true, true)
- elseif tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType == "premium" then
- dxDrawText("\195\129r: #32b3ef" .. thousandsStepper(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price) .. " PP", respc(10), screenHeight - respc(75), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto, "left", "top", false, false, true, true, true)
- elseif tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType == "free" then
- dxDrawText("\195\129r: #d75959Ingyenes", respc(10), screenHeight - respc(75), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto, "left", "top", false, false, true, true, true)
- end
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].hint then
- dxDrawText(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].hint, respc(10), screenHeight - respc(75) + respc(25), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- end
- end
- dxDrawImage(screenWidth - respc(582), screenHeight - respc(75), respc(128), respc(32), "files/nav/enter.png")
- dxDrawText("V\195\161s\195\161rl\195\161s", screenWidth - respc(582) + respc(66), screenHeight - respc(75) + respc(5), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- dxDrawImage(screenWidth - respc(582) + respc(130), screenHeight - respc(75), respc(128), respc(32), "files/nav/backspace.png")
- dxDrawText("Kil\195\169p\195\169s", screenWidth - respc(582) + respc(216), screenHeight - respc(75) + respc(5), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- dxDrawImage(screenWidth - respc(582) + respc(268), screenHeight - respc(75), respc(32), respc(32), "files/nav/up.png")
- dxDrawImage(screenWidth - respc(582) + respc(300), screenHeight - respc(75), respc(32), respc(32), "files/nav/down.png")
- dxDrawText("Navig\195\161ci\195\179", screenWidth - respc(582) + respc(336), screenHeight - respc(75) + respc(5), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- dxDrawImage(screenWidth - respc(582) + respc(408), screenHeight - respc(75), respc(32), respc(32), "files/nav/mouse.png")
- dxDrawText("Kamera mozgat\195\161s", screenWidth - respc(582) + respc(442), screenHeight - respc(75) + respc(5), 0, 0, tocolor(255, 255, 255, 255), 1, Roboto4, "left", "top", false, false, true, true, true)
- dxDrawRectangle(menuPosX, menuPosY, menuWidth, menuHeight, tocolor(0, 0, 0, 150))
- dxDrawRectangle(menuPosX, menuPosY, menuWidth, 2, tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX, menuPosY + menuHeight - 2, menuWidth, 2, tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX, menuPosY + 2, 2, menuHeight - 4, tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX + menuWidth - 2, menuPosY + 2, 2, menuHeight - 4, tocolor(0, 0, 0, 200))
- if 0 < notVisibleCount then
- if 1 < smallestVisible then
- dxDrawRectangle(menuPosX + menuWidth, menuPosY + (menuHeight - menuHeight / #tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu * visibleCount) / notVisibleCount * (smallestVisible - 1), 3, menuHeight / #tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu * visibleCount, tocolor(255, 255, 255, 255))
- else
- dxDrawRectangle(menuPosX + menuWidth, menuPosY, 3, menuHeight / #tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu * visibleCount, tocolor(255, 255, 255, 255))
- end
- end
- for _FORV_14_ = 1, #tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu do
- if _UPVALUE0_[_FORV_14_] then
- if (selectedMenu ~= _FORV_14_ or true) and 0 % 2 ~= 0 then
- dxDrawRectangle(menuPosX, menuPosY + 0 * rowHeight, menuWidth, rowHeight, tocolor(0, 0, 0, 200))
- end
- end
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu] then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value == 0 then
- elseif tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType == "premium" then
- end
- end
- end
- if true then
- dxDrawRectangle(menuPosX, interpolateBetween(_UPVALUE10_, 0, 0, _UPVALUE11_, 0, 0, (getTickCount() - _UPVALUE8_) / _UPVALUE9_, "Linear"))
- else
- dxDrawRectangle(menuPosX, _UPVALUE11_, menuWidth, rowHeight, (tocolor(50, 179, 239, 200)))
- end
- for _FORV_18_ = 1, #tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu do
- if _UPVALUE0_[_FORV_18_] then
- if tuningContainer[currentLevel].subMenu[currentSubLevel] and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_] then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].clientFunction and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].value then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].clientFunction(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].value) then
- dxDrawImage(menuPosX + respc(10), menuPosY + 0 * rowHeight + respc(4), respc(32), respc(32), "files/icons/felszerelt.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawText(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].name .. " #32b3ef(Felszerelve)", menuPosX, menuPosY + 0 * rowHeight, menuPosX + menuWidth - respc(20), menuPosY + 0 * rowHeight + rowHeight, tocolor(255, 255, 255, 255), 1, Roboto, "right", "center", false, false, true, true, true)
- else
- dxDrawImage(menuPosX + respc(10), menuPosY + 0 * rowHeight + respc(4), respc(32), respc(32), tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].icon, 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawText(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].name, menuPosX, menuPosY + 0 * rowHeight, menuPosX + menuWidth - respc(20), menuPosY + 0 * rowHeight + rowHeight, tocolor(255, 255, 255, 255), 1, Roboto, "right", "center", false, false, true, true, true)
- end
- else
- dxDrawImage(menuPosX + respc(10), menuPosY + 0 * rowHeight + respc(4), respc(32), respc(32), tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].icon, 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawText(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].name, menuPosX, menuPosY + 0 * rowHeight, menuPosX + menuWidth - respc(20), menuPosY + 0 * rowHeight + rowHeight, tocolor(255, 255, 255, 255), 1, Roboto, "right", "center", false, false, true, true, true)
- end
- else
- dxDrawImage(menuPosX + respc(10), menuPosY + 0 * rowHeight + respc(4), respc(32), respc(32), tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].icon, 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawText(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[_FORV_18_].name, menuPosX, menuPosY + 0 * rowHeight, menuPosX + menuWidth - respc(20), menuPosY + 0 * rowHeight + rowHeight, tocolor(255, 255, 255, 255), 1, Roboto, "right", "center", false, false, true, true, true)
- end
- end
- end
- if _FOR_ then
- dxDrawRectangle(menuPosX, menuPosY + menuHeight, respc(400), respc(60), tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX + respc(400) / 2 - respc(25), menuPosY + menuHeight + respc(10), respc(50), respc(40), tocolor(0, 0, 0, 200))
- dxDrawText(_UPVALUE12_[1], menuPosX + respc(400) / 2 - respc(25), menuPosY + menuHeight + respc(10), menuPosX + respc(400) / 2 + respc(25), menuPosY + menuHeight + respc(10) + respc(40), tocolor(255, 255, 255, 255), 0.55, Roboto3, "center", "center", false, false, true, true, true)
- end
- if editPlate then
- dxDrawRectangle(menuPosX, menuPosY + menuHeight, respc(400), respc(60), tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX, menuPosY + menuHeight, respc(400), 2, tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX, menuPosY + menuHeight + respc(60) - 2, respc(400), 2, tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX, menuPosY + menuHeight + 2, 2, respc(60) - 4, tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX + respc(400) - 2, menuPosY + menuHeight + 2, 2, respc(60) - 4, tocolor(0, 0, 0, 200))
- dxDrawRectangle(menuPosX + respc(10), menuPosY + menuHeight + respc(10), respc(400) - respc(20), respc(40), tocolor(100, 100, 100, 160))
- dxDrawText(getVehiclePlateText(vehicleElement) or "":upper(), menuPosX + respc(4), menuPosY + menuHeight + respc(14), menuPosX + respc(400) - respc(9), 0, tocolor(255, 255, 255, 255), 1, Roboto2, "center", "top", false, false, true, true, true)
- end
- if _UPVALUE13_ + _UPVALUE14_ > getTickCount() then
- dxDrawRectangle(screenWidth / 2 - respc(200), screenHeight - respc(120), respc(400), respc(30), tocolor(0, 0, 0, 160))
- dxDrawRectangle(screenWidth / 2 - respc(200), screenHeight - respc(120), reMap(getTickCount() - _UPVALUE13_, 0, _UPVALUE14_, 0, respc(400)), respc(30), tocolor(124, 197, 118, 160))
- dxDrawText(_UPVALUE15_, screenWidth / 2 - respc(200), screenHeight - respc(120) + 1, screenWidth / 2 - respc(200) + respc(400), screenHeight - respc(120) + respc(30), tocolor(255, 255, 255, 255), 1, Roboto4, "center", "center", false, false, true, true, true)
- end
- if _UPVALUE16_ then
- buttons = {}
- dxDrawRectangle(screenWidth / 2 - respc(600) / 2, screenHeight / 2 - respc(200) / 2, respc(600), respc(200), tocolor(0, 0, 0, 150))
- if "premium" == "premium" then
- else
- end
- dxDrawText("#FFFFFFT\195\169nyleg meg szeretn\195\169d v\195\161s\195\161rolni a kiv\195\161lasztott tuningot?\n" .. ("premium" == "premium" and "#32b3ef" or "#7cc576") .. "A tuning \195\161ra: " .. "Ingyenes", screenWidth / 2 - respc(600) / 2, screenHeight / 2 - respc(200) / 2, screenWidth / 2 - respc(600) / 2 + respc(600), screenHeight / 2 - respc(200) / 2 + respc(200) - respc(100), tocolor(255, 255, 255, 255), 1, Roboto, "center", "center", false, false, false, true)
- dxDrawRectangle(screenWidth / 2 - respc(600) / 2 + respc(30), screenHeight / 2 - respc(200) / 2 + respc(200) - respc(100) + respc(30), respc(600) / 2 - respc(30) * 2, respc(100) - respc(30) * 2, tocolor(217, 83, 79, 150))
- dxDrawText("M\195\169gsem (Backspace)", screenWidth / 2 - respc(600) / 2 + respc(30), screenHeight / 2 - respc(200) / 2 + respc(200) - respc(100) + respc(30), screenWidth / 2 - respc(600) / 2 + respc(30) + respc(600) / 2 - respc(30) * 2, screenHeight / 2 - respc(200) / 2 + respc(200) - respc(100) + respc(30) + 100 - respc(30) * 2, tocolor(0, 0, 0, 255), 1, Roboto, "center", "center", false, false, false, true)
- dxDrawRectangle(screenWidth / 2 - respc(600) / 2 + respc(600) / 2 + respc(30), screenHeight / 2 - respc(200) / 2 + respc(200) - respc(100) + respc(30), respc(600) / 2 - respc(30) * 2, respc(100) - respc(30) * 2, tocolor(124, 197, 118, 150))
- dxDrawText("V\195\161s\195\161rl\195\161s (Enter)", screenWidth / 2 - respc(600) / 2 + respc(600) / 2 + respc(30), screenHeight / 2 - respc(200) / 2 + respc(200) - respc(100) + respc(30), screenWidth / 2 - respc(600) / 2 + respc(600) / 2 + respc(30) + respc(600) / 2 - respc(30) * 2, screenHeight / 2 - respc(200) / 2 + respc(200) - respc(100) + respc(30) + respc(100) - respc(30) * 2, tocolor(0, 0, 0, 255), 1, Roboto, "center", "center", false, false, false, true)
- dxDrawText("#7cc576SeeMTA - #FF9600Tuning", screenWidth / 2 - respc(600) / 2, screenHeight / 2 - respc(200) / 2 - respc(20), screenWidth / 2 - respc(600) / 2, screenHeight / 2 - respc(200) / 2, tocolor(255, 255, 255, 255), 1, Roboto, "left", "center", false, false, false, true)
- activeButton = false
- for _FORV_24_, _FORV_25_ in pairs(buttons) do
- if getCursorPosition() >= _FORV_25_[1] and getCursorPosition() <= _FORV_25_[3] and getCursorPosition() >= _FORV_25_[2] and getCursorPosition() <= _FORV_25_[4] then
- activeButton = _FORV_24_
- end
- end
- end
- end
- end)
- addEvent("resetSpinner", true)
- addEventHandler("resetSpinner", getRootElement(), function(_ARG_0_)
- if isElement(source) then
- setElementData(source, "tuningSpinners", _ARG_0_)
- outputDebugString("resetSpinner")
- end
- end)
- addEventHandler("onClientKey", getRootElement(), function(_ARG_0_, _ARG_1_)
- if panelState and _ARG_1_ then
- if activeColorInput then
- cancelEvent()
- return
- end
- if (_ARG_0_ == "mouse_wheel_up" or _ARG_0_ == "mouse_wheel_down") and not _UPVALUE0_ and not _UPVALUE1_ then
- if _ARG_0_ == "mouse_wheel_down" then
- if _UPVALUE2_ > 1 and _UPVALUE3_ == "base" or _UPVALUE2_ > 0.75 and _UPVALUE3_ ~= "base" then
- if _UPVALUE3_ ~= "base" then
- else
- end
- _UPVALUE4_ = {_UPVALUE2_, 1}
- _UPVALUE0_ = getTickCount()
- end
- elseif _UPVALUE2_ <= 3 then
- _UPVALUE4_ = {
- _UPVALUE2_,
- _UPVALUE2_ + 0.2 * _UPVALUE2_
- }
- _UPVALUE0_ = getTickCount()
- end
- end
- if not buyingInProgress and _UPVALUE5_ + _UPVALUE6_ <= getTickCount() then
- if selectionLevel == 1 then
- elseif selectionLevel == 2 then
- end
- if variantEditor and getTickCount() - _UPVALUE7_ >= 250 then
- if _ARG_0_ == "arrow_u" then
- _UPVALUE8_[variantEditor] = _UPVALUE8_[variantEditor] + 1
- if _UPVALUE8_[variantEditor] > 6 then
- _UPVALUE8_[variantEditor] = 0
- end
- triggerServerEvent("previewVariant", vehicleElement, _UPVALUE8_)
- elseif _ARG_0_ == "arrow_d" then
- _UPVALUE8_[variantEditor] = _UPVALUE8_[variantEditor] - 1
- if _UPVALUE8_[variantEditor] < 0 then
- _UPVALUE8_[variantEditor] = 6
- end
- triggerServerEvent("previewVariant", vehicleElement, _UPVALUE8_)
- end
- _UPVALUE7_ = getTickCount()
- end
- if _ARG_0_ == "arrow_u" and not _UPVALUE9_ and not variantEditor then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu - 1] then
- if selectedMenu <= _UPVALUE10_ then
- moveSelection(_UPVALUE10_ - 1)
- end
- selectedMenu = selectedMenu - 1
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].colorPicker then
- colorPicker = true
- colorInputs = false
- colorX = false
- else
- colorPicker = false
- end
- if selectionLevel == 2 and tuningContainer[currentLevel].subMenu[currentSubLevel].hornSound then
- if isElement(_UPVALUE11_) then
- destroyElement(_UPVALUE11_)
- end
- if 0 < tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- _UPVALUE11_ = playSound(":sas_customhorn/horns/" .. tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value .. ".mp3")
- end
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].licensePlate then
- togglePlateEdit(true)
- else
- togglePlateEdit(false)
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].isSpinnerItem then
- if colorPicker then
- exports.sas_spinner:previewSpinner(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, true)
- else
- exports.sas_spinner:previewSpinner(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value)
- end
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].id == "color" then
- setVehicleColor(vehicleElement, vehicleColor[1], vehicleColor[2], vehicleColor[3], vehicleColor[4], vehicleColor[5], vehicleColor[6], vehicleColor[7], vehicleColor[8], vehicleColor[9], vehicleColor[10], vehicleColor[11], vehicleColor[12])
- setVehicleHeadLightColor(vehicleElement, vehicleLightColor[1], vehicleLightColor[2], vehicleLightColor[3])
- if not tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].id2 and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].camera then
- changeCamera(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].camera)
- end
- end
- if isElement(_UPVALUE12_) then
- destroyElement(_UPVALUE12_)
- end
- _UPVALUE12_ = nil
- playSound("files/sounds/menunavigate.mp3")
- else
- end
- if selectionLevel == 2 then
- installOpticalTuning()
- installNeon()
- installHandling()
- installDoor()
- installPaintjob()
- installHeadlight()
- end
- elseif _ARG_0_ == "arrow_d" and not _UPVALUE9_ and not variantEditor then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu + 1] then
- if _UPVALUE13_[selectedMenu + 1] then
- moveSelection(selectedMenu + 1)
- end
- selectedMenu = selectedMenu + 1
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].colorPicker then
- colorPicker = true
- colorInputs = false
- colorX = false
- else
- colorPicker = false
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].licensePlate then
- togglePlateEdit(true)
- else
- togglePlateEdit(false)
- end
- if selectionLevel == 2 and tuningContainer[currentLevel].subMenu[currentSubLevel].hornSound then
- if isElement(_UPVALUE11_) then
- destroyElement(_UPVALUE11_)
- end
- if 0 < tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- _UPVALUE11_ = playSound(":sas_customhorn/horns/" .. tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value .. ".mp3")
- end
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].id == "color" then
- setVehicleColor(vehicleElement, vehicleColor[1], vehicleColor[2], vehicleColor[3], vehicleColor[4], vehicleColor[5], vehicleColor[6], vehicleColor[7], vehicleColor[8], vehicleColor[9], vehicleColor[10], vehicleColor[11], vehicleColor[12])
- setVehicleHeadLightColor(vehicleElement, vehicleLightColor[1], vehicleLightColor[2], vehicleLightColor[3])
- if not tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].id2 and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].camera then
- changeCamera(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].camera)
- end
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].isSpinnerItem then
- if colorPicker then
- exports.sas_spinner:previewSpinner(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, true)
- else
- exports.sas_spinner:previewSpinner(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value)
- end
- end
- playSound("files/sounds/menunavigate.mp3")
- if selectionLevel == 2 and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].supercharger and _UPVALUE14_[getElementModel(vehicleElement)] then
- _UPVALUE12_ = createObject(2052, 0, 0, 0)
- attachElements(_UPVALUE12_, vehicleElement, unpack(_UPVALUE14_[getElementModel(vehicleElement)]))
- setElementCollisionsEnabled(_UPVALUE12_, false)
- setElementPosition(vehicleElement, getElementPosition(vehicleElement))
- setElementPosition(vehicleElement, getElementPosition(vehicleElement))
- end
- else
- end
- if selectionLevel == 2 then
- installOpticalTuning()
- installNeon()
- installHandling()
- installDoor()
- installPaintjob()
- installHeadlight()
- end
- elseif _ARG_0_ == "enter" then
- if _UPVALUE9_ then
- buyTuning()
- _UPVALUE9_ = false
- elseif selectionLevel == 0 then
- currentLevel = selectedMenu
- selectionLevel = 1
- selectedMenu = 1
- moveSelection(1)
- if tuningContainer[currentLevel].subMenu[selectedMenu].colorPicker then
- colorPicker = true
- colorInputs = false
- colorX = false
- else
- colorPicker = false
- end
- playSound("files/sounds/menuselect.mp3")
- elseif selectionLevel == 1 then
- if tuningContainer[currentLevel].subMenu[selectedMenu] then
- if variantEditor then
- confirmTuning()
- return
- end
- if (tuningContainer[currentLevel].subMenu[selectedMenu].handlingPrefix == "WHEEL_F_" or tuningContainer[currentLevel].subMenu[selectedMenu].handlingPrefix == "WHEEL_R_") and getElementData(vehicleElement, "tuningSpinners") then
- exports.sas_accounts:showInfo("e", "El\197\145bb szereld le a spinnert!")
- return
- end
- if tuningContainer[currentLevel].subMenu[selectedMenu].isSpinner then
- if _UPVALUE15_[getElementModel(vehicleElement)] or getVehicleType(vehicleElement) ~= "Automobile" then
- exports.sas_accounts:showInfo("e", "Ez az alkatr\195\169sz nem kompatibilis a j\195\161rm\197\177veddel!")
- return
- end
- for _FORV_10_ in pairs(getVehicleHandlingFlags(vehicleElement)) do
- if string.sub(_FORV_10_, 1, 6) == "WHEEL_" then
- exports.sas_accounts:showInfo("e", "El\197\145bb szereld \195\161t a kerekeid sz\195\169less\195\169g\195\169t norm\195\161lra!")
- return
- end
- end
- exports.sas_spinner:getSizeForPreview(vehicleElement)
- exports.sas_spinner:previewSpinner(vehicleElement, tuningContainer[currentLevel].subMenu[selectedMenu].subMenu[1].value, r, g, b)
- end
- if tuningContainer[currentLevel].subMenu[selectedMenu].variantEditor then
- variantEditor = 1
- _UPVALUE8_ = {}
- _UPVALUE8_[1] = getElementData(vehicleElement, "variant1") or 0
- _UPVALUE8_[2] = getElementData(vehicleElement, "variant2") or 0
- return
- else
- variantEditor = false
- end
- if tuningContainer[currentLevel].subMenu[selectedMenu].upgradeSlot then
- tuningContainer[currentLevel].subMenu[selectedMenu].subMenu = {}
- if getVehicleCompatibleUpgrades(vehicleElement, tuningContainer[currentLevel].subMenu[selectedMenu].upgradeSlot) and 0 < #getVehicleCompatibleUpgrades(vehicleElement, tuningContainer[currentLevel].subMenu[selectedMenu].upgradeSlot) then
- table.insert(tuningContainer[currentLevel].subMenu[selectedMenu].subMenu, {
- name = "Gy\195\161ri",
- icon = tuningContainer[currentLevel].subMenu[selectedMenu].icon,
- priceType = "free",
- price = 0,
- value = 0
- })
- for _FORV_10_, _FORV_11_ in ipairs((getVehicleCompatibleUpgrades(vehicleElement, tuningContainer[currentLevel].subMenu[selectedMenu].upgradeSlot))) do
- table.insert(tuningContainer[currentLevel].subMenu[selectedMenu].subMenu, {
- name = componentNames[_FORV_11_],
- icon = tuningContainer[currentLevel].subMenu[selectedMenu].icon,
- priceType = tuningContainer[currentLevel].subMenu[selectedMenu].priceType,
- price = tuningContainer[currentLevel].subMenu[selectedMenu].price,
- value = _FORV_11_
- })
- end
- else
- tuningContainer[currentLevel].subMenu[selectedMenu].subMenu = false
- end
- elseif tuningContainer[currentLevel].subMenu[selectedMenu].id == "paintjob" then
- if exports.sas_paintjob:getPaintJobCount(getElementModel(vehicleElement)) then
- tuningContainer[currentLevel].subMenu[selectedMenu].subMenu = {}
- table.insert(tuningContainer[currentLevel].subMenu[selectedMenu].subMenu, {
- name = "Gy\195\161ri",
- icon = "files/icons/free.png",
- priceType = "free",
- price = 0,
- value = 0
- })
- for _FORV_10_ = 1, exports.sas_paintjob:getPaintJobCount(getElementModel(vehicleElement)) do
- table.insert(tuningContainer[currentLevel].subMenu[selectedMenu].subMenu, {
- name = "Paintjob " .. _FORV_10_,
- icon = "files/icons/pp.png",
- priceType = "premium",
- price = 1800,
- value = _FORV_10_
- })
- end
- end
- elseif tuningContainer[currentLevel].subMenu[selectedMenu].id == "headlight" then
- if exports.sas_headlight:getHeadLightCount(getElementModel(vehicleElement)) then
- tuningContainer[currentLevel].subMenu[selectedMenu].subMenu = {}
- table.insert(tuningContainer[currentLevel].subMenu[selectedMenu].subMenu, {
- name = "Gy\195\161ri",
- icon = "files/icons/free.png",
- priceType = "free",
- price = 0,
- value = 0,
- hint = "V\195\161s\195\161rl\195\161s el\197\145tt aj\195\161nlott fel- \195\169s lekapcsolt l\195\161mp\195\161val is megtekinteni a j\195\161rm\197\177vet. (L gomb)"
- })
- for _FORV_10_ = 1, exports.sas_headlight:getHeadLightCount(getElementModel(vehicleElement)) do
- table.insert(tuningContainer[currentLevel].subMenu[selectedMenu].subMenu, {
- name = "F\195\169nysz\195\179r\195\179 " .. _FORV_10_,
- icon = "files/icons/pp.png",
- priceType = "premium",
- price = 1200,
- value = _FORV_10_,
- hint = "V\195\161s\195\161rl\195\161s el\197\145tt aj\195\161nlott fel- \195\169s lekapcsolt l\195\161mp\195\161val is megtekinteni a j\195\161rm\197\177vet. (L gomb)"
- })
- end
- end
- elseif tuningContainer[currentLevel].subMenu[selectedMenu].id == "color" then
- colorPicker = true
- colorInputs = false
- colorX = false
- end
- end
- if tuningContainer[currentLevel].subMenu[selectedMenu].subMenu then
- currentSubLevel = selectedMenu
- selectionLevel = 2
- if tuningContainer[currentLevel].subMenu[selectedMenu] and tuningContainer[currentLevel].subMenu[selectedMenu].camera then
- changeCamera(tuningContainer[currentLevel].subMenu[selectedMenu].camera)
- end
- selectedMenu = 1
- moveSelection(1)
- installOpticalTuning()
- installNeon()
- installHandling()
- installDoor()
- installPaintjob()
- installHeadlight()
- playSound("files/sounds/menuselect.mp3")
- elseif tuningContainer[currentLevel].subMenu[selectedMenu].id == "color" then
- confirmTuning()
- else
- exports.sas_accounts:showInfo("e", "Sajnos a kiv\195\161lasztott alkatr\195\169sz nem kompatibilis a j\195\161rm\197\177veddel!")
- end
- elseif selectionLevel == 2 then
- if tuningContainer[currentLevel].subMenu[currentSubLevel] and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].supercharger and not _UPVALUE14_[getElementModel(vehicleElement)] then
- exports.sas_accounts:showInfo("e", "Ezzel az aut\195\179val nem kompatibilis a supercharger.")
- return
- end
- confirmTuning()
- end
- elseif _ARG_0_ == "backspace" then
- if _UPVALUE9_ then
- _UPVALUE9_ = false
- elseif variantEditor then
- variantEditor = false
- triggerServerEvent("previewVariant", vehicleElement, false)
- elseif not editPlate then
- colorPicker = false
- togglePlateEdit(false)
- if selectionLevel > 0 then
- if selectionLevel == 1 then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].id == "color" then
- setVehicleColor(vehicleElement, vehicleColor[1], vehicleColor[2], vehicleColor[3], vehicleColor[4], vehicleColor[5], vehicleColor[6], vehicleColor[7], vehicleColor[8], vehicleColor[9], vehicleColor[10], vehicleColor[11], vehicleColor[12])
- setVehicleHeadLightColor(vehicleElement, vehicleLightColor[1], vehicleLightColor[2], vehicleLightColor[3])
- end
- currentLevel = 0
- selectionLevel = 0
- currentSubLevel = 1
- moveSelection(1)
- selectedMenu = 1
- elseif selectionLevel == 2 then
- if tuningContainer[currentLevel].subMenu[currentSubLevel].isSpinner then
- triggerServerEvent("resetSpinner", vehicleElement)
- end
- restoreOpticalTuning()
- restoreNeon()
- restoreHandling()
- restoreDoor()
- restorePaintjob()
- restoreHeadlight()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id == "color" then
- setVehicleColor(vehicleElement, vehicleColor[1], vehicleColor[2], vehicleColor[3], vehicleColor[4], vehicleColor[5], vehicleColor[6], vehicleColor[7], vehicleColor[8], vehicleColor[9], vehicleColor[10], vehicleColor[11], vehicleColor[12])
- setVehicleHeadLightColor(vehicleElement, vehicleLightColor[1], vehicleLightColor[2], vehicleLightColor[3])
- end
- selectionLevel = 1
- currentSubLevel = 1
- moveSelection(1)
- selectedMenu = 1
- changeCamera("base")
- end
- else
- triggerServerEvent("exitTuning", localPlayer)
- end
- if isElement(_UPVALUE12_) then
- destroyElement(_UPVALUE12_)
- end
- _UPVALUE12_ = nil
- playSound("files/sounds/menuback.mp3")
- elseif 1 <= utfLen(getVehiclePlateText(vehicleElement) or "") then
- setVehiclePlateText(vehicleElement, (getVehiclePlateText(vehicleElement) or "":sub(1, utfLen(getVehiclePlateText(vehicleElement) or "") - 1)))
- end
- end
- end
- if colorPicker then
- if _ARG_0_ ~= "escape" and _ARG_0_ ~= "l" and _ARG_0_ ~= "mouse1" then
- cancelEvent()
- end
- elseif _ARG_0_ ~= "escape" and _ARG_0_ ~= "l" then
- cancelEvent()
- end
- end
- end)
- addEventHandler("onClientCharacter", getRootElement(), function(_ARG_0_)
- if panelState and editPlate and (string.find(_ARG_0_, "[a-z]") or string.find(_ARG_0_, "[0-9]") or _ARG_0_ == "-") then
- if utfLen(getVehiclePlateText(vehicleElement) or "") < 8 then
- setVehiclePlateText(vehicleElement, (getVehiclePlateText(vehicleElement) or "") .. _ARG_0_:upper())
- end
- end
- end)
- function restoreOpticalTuning()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot then
- if getVehicleUpgradeOnSlot(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot) and getVehicleUpgradeOnSlot(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot) > 0 then
- removeVehicleUpgrade(vehicleElement, (getVehicleUpgradeOnSlot(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot)))
- end
- if originalUpgrade and 0 < originalUpgrade then
- addVehicleUpgrade(vehicleElement, originalUpgrade)
- originalUpgrade = false
- end
- end
- end
- function installOpticalTuning()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot then
- if getVehicleUpgradeOnSlot(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot) and getVehicleUpgradeOnSlot(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot) > 0 then
- removeVehicleUpgrade(vehicleElement, (getVehicleUpgradeOnSlot(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot)))
- if not originalUpgrade then
- originalUpgrade = getVehicleUpgradeOnSlot(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot)
- end
- elseif not originalUpgrade then
- originalUpgrade = 0
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value and 0 < tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- addVehicleUpgrade(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value)
- end
- end
- end
- function installNeon()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "neon" then
- if not neonId then
- neonId = getElementData(vehicleElement, "tuning.neon")
- end
- if not neonState then
- neonState = getElementData(vehicleElement, "tuning.neon.state")
- end
- setElementData(vehicleElement, "tuning.neon", tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, false)
- setElementData(vehicleElement, "tuning.neon.state", 1, false)
- end
- end
- function restoreNeon()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "neon" then
- if neonState then
- setElementData(vehicleElement, "tuning.neon.state", neonState)
- neonState = false
- end
- if neonId then
- setElementData(vehicleElement, "tuning.neon", neonId)
- neonId = false
- end
- end
- end
- function installHandling()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "handling" and tuningContainer[currentLevel].subMenu[currentSubLevel].handlingPrefix then
- if not originalHandling then
- originalHandling = getVehicleHandling(vehicleElement).handlingFlags
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- for _FORV_8_ in pairs(getVehicleHandlingFlags(vehicleElement)) do
- end
- triggerServerEvent("setVehicleHandling", localPlayer, "handlingFlags", getVehicleHandlingFlags(vehicleElement) - handlingFlags[_FORV_8_] + handlingFlags[tuningContainer[currentLevel].subMenu[currentSubLevel].handlingPrefix .. tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value])
- end
- end
- end
- function restoreHandling()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "handling" and originalHandling then
- triggerServerEvent("setVehicleHandling", localPlayer, "handlingFlags", originalHandling)
- originalHandling = false
- end
- end
- function installDoor()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "door" then
- if not originalDoor then
- originalDoor = getElementData(vehicleElement, "vDoorType") or 0
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- setElementData(vehicleElement, "vDoorType", tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, false)
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value == 0 then
- setVehicleDoorOpenRatio(vehicleElement, 2, 0, 500)
- setVehicleDoorOpenRatio(vehicleElement, 3, 0, 500)
- else
- setVehicleDoorOpenRatio(vehicleElement, 2, 1, 500)
- setVehicleDoorOpenRatio(vehicleElement, 3, 1, 500)
- end
- end
- end
- end
- function restoreDoor()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "door" then
- setVehicleDoorOpenRatio(vehicleElement, 2, 0, 500)
- setVehicleDoorOpenRatio(vehicleElement, 3, 0, 500)
- if originalDoor ~= false then
- if originalDoor == 0 then
- setElementData(vehicleElement, "vDoorType", false, false)
- else
- setElementData(vehicleElement, "vDoorType", originalDoor, false)
- end
- originalDoor = false
- end
- end
- end
- function installPaintjob()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "paintjob" then
- if not originalPaintjob then
- originalPaintjob = getElementData(vehicleElement, "vehicle.currentTexture")
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- exports.sas_paintjob:applyPaintJob(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, false)
- end
- end
- end
- function restorePaintjob()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "paintjob" and originalPaintjob then
- setElementData(vehicleElement, "vehicle.currentTexture", originalPaintjob)
- originalPaintjob = false
- end
- end
- function installHeadlight()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "headlight" then
- if not originalHeadLight then
- originalHeadLight = getElementData(vehicleElement, "vehicle.currentHeadLight")
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value then
- exports.sas_headlight:applyHeadLight(tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, false)
- end
- end
- end
- function restoreHeadlight()
- if tuningContainer[currentLevel].subMenu[currentSubLevel].id and tuningContainer[currentLevel].subMenu[currentSubLevel].id == "headlight" and originalHeadLight then
- setElementData(vehicleElement, "vehicle.currentHeadLight", originalHeadLight)
- originalHeadLight = false
- end
- end
- function togglePlateEdit(_ARG_0_)
- editPlate = _ARG_0_
- if editPlate then
- if not originalPlate then
- originalPlate = getVehiclePlateText(vehicleElement) or ""
- end
- elseif originalPlate then
- setVehiclePlateText(vehicleElement, originalPlate)
- originalPlate = false
- end
- end
- function moveSelection(_ARG_0_)
- if _ARG_0_ then
- _UPVALUE0_ = getTickCount()
- _UPVALUE1_ = _UPVALUE2_
- _UPVALUE2_ = menuPosY + (_ARG_0_ - 1) * rowHeight
- _UPVALUE3_ = _ARG_0_
- end
- end
- function confirmTuning()
- if panelState and not buyingInProgress and not _UPVALUE0_ then
- _UPVALUE0_ = true
- end
- end
- function buyTuning()
- if panelState and not buyingInProgress and _UPVALUE0_ then
- if variantEditor then
- variantEditor = false
- buyingInProgress = true
- triggerServerEvent("buyVariantTuning", localPlayer, _UPVALUE1_, tuningContainer[currentLevel].subMenu[selectedMenu].price)
- return
- end
- if selectionLevel == 2 and tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].isSpinnerItem then
- buyingInProgress = true
- triggerServerEvent("buySpinnerTuning", localPlayer, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, exports.sas_spinner:getPreviewColor())
- return
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot and selectionLevel == 2 then
- triggerServerEvent("buyOpticalTuning", localPlayer, tuningContainer[currentLevel].subMenu[currentSubLevel].upgradeSlot, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price)
- buyingInProgress = true
- elseif tuningContainer[currentLevel].subMenu[currentSubLevel].id == "paintjob" and selectionLevel == 2 then
- triggerServerEvent("buyPaintjob", localPlayer, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price)
- buyingInProgress = true
- elseif tuningContainer[currentLevel].subMenu[currentSubLevel].id == "headlight" and selectionLevel == 2 then
- triggerServerEvent("buyHeadLight", localPlayer, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price)
- buyingInProgress = true
- elseif tuningContainer[currentLevel].subMenu[selectedMenu].id == "color" and selectionLevel == 1 then
- if not compareTables(vehicleColor, {
- getVehicleColor(vehicleElement, true)
- }) or not compareTables(vehicleLightColor, {
- getVehicleHeadLightColor(vehicleElement)
- }) or tuningContainer[currentLevel].subMenu[selectedMenu].colorId == 7 then
- triggerServerEvent("buyColor", localPlayer, tuningContainer[currentLevel].subMenu[selectedMenu].colorId, {
- getVehicleColor(vehicleElement, true)
- }, {
- getVehicleHeadLightColor(vehicleElement)
- }, tuningContainer[currentLevel].subMenu[selectedMenu].priceType, tuningContainer[currentLevel].subMenu[selectedMenu].price)
- triggerEvent("resetSpeedoColor", vehicleElement)
- buyingInProgress = true
- else
- exports.sas_accounts:showInfo("e", "A kiv\195\161lasztott sz\195\173n nem lehet ugyan az, mint a jelenlegi.")
- buyingInProgress = false
- end
- elseif tuningContainer[currentLevel].subMenu[currentSubLevel].id == "color" and selectionLevel == 2 then
- if not compareTables(vehicleColor, {
- getVehicleColor(vehicleElement, true)
- }) or not compareTables(vehicleLightColor, {
- getVehicleHeadLightColor(vehicleElement)
- }) or tuningContainer[currentLevel].subMenu[selectedMenu].colorId == 7 then
- triggerServerEvent("buyColor", localPlayer, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].colorId, {
- getVehicleColor(vehicleElement, true)
- }, {
- getVehicleHeadLightColor(vehicleElement)
- }, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price)
- buyingInProgress = true
- else
- exports.sas_accounts:showInfo("e", "A kiv\195\161lasztott sz\195\173n nem lehet ugyan az, mint a jelenlegi.")
- buyingInProgress = false
- end
- elseif tuningContainer[currentLevel].subMenu[currentSubLevel].id == "licensePlate" and selectionLevel == 2 then
- if getVehiclePlateText(vehicleElement) then
- triggerServerEvent("buyLicensePlate", localPlayer, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].value, getVehiclePlateText(vehicleElement), tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].priceType, tuningContainer[currentLevel].subMenu[currentSubLevel].subMenu[selectedMenu].price)
- buyingInProgress = true
- else
- exports.sas_accounts:showInfo("e", "A j\195\161rm\197\177 nem maradhat rendsz\195\161m n\195\169lk\195\188l!")
- buyingInProgress = false
- togglePlateEdit(false)
- end
- else
- triggerServerEvent("buyTuning", localPlayer, currentLevel, currentSubLevel, selectedMenu)
- buyingInProgress = true
- end
- selectedMenu = 1
- moveSelection(1)
- end
- end
- addEvent("buyTuning", true)
- addEventHandler("buyTuning", getRootElement(), function(_ARG_0_, _ARG_1_, _ARG_2_)
- if _ARG_0_ == "success" then
- neonId = false
- neonState = false
- originalHandling = false
- originalDoor = false
- if _ARG_1_ == "neon" then
- setElementData(vehicleElement, "tuning.neon.state", 0, false)
- elseif _ARG_1_ == "paintjob" and _ARG_2_ then
- exports.sas_paintjob:applyPaintJob(vehicleElement, _ARG_2_, true)
- end
- if _ARG_2_ == 0 then
- startBuyProgress("newpart", "Leszerel\195\169s...")
- else
- startBuyProgress("newpart", "Felszerel\195\169s...")
- end
- elseif _ARG_0_ == "failed" then
- if neonId then
- setElementData(vehicleElement, "tuning.neon", neonId, false)
- neonId = false
- end
- if neonState then
- setElementData(vehicleElement, "tuning.neon.state", neonState, false)
- neonState = false
- end
- end
- buyingInProgress = false
- end)
- addEvent("buyOpticalTuning", true)
- addEventHandler("buyOpticalTuning", getRootElement(), function(_ARG_0_, _ARG_1_)
- if _ARG_0_ == "success" then
- if _ARG_1_ then
- originalUpgrade = _ARG_1_
- if _ARG_1_ == 0 then
- startBuyProgress("newpart", "Leszerel\195\169s...")
- else
- startBuyProgress("newpart", "Felszerel\195\169s...")
- end
- end
- elseif _ARG_0_ == "failed" then
- end
- buyingInProgress = false
- end)
- addEvent("buyVariant", true)
- addEventHandler("buyVariant", getRootElement(), function(_ARG_0_)
- if _ARG_0_ == "success" then
- startBuyProgress("newpart", "Felszerel\195\169s...")
- elseif _ARG_0_ == "successdown" then
- startBuyProgress("newpart", "Leszerel\195\169s...")
- end
- buyingInProgress = false
- end)
- addEvent("buyPaintjob", true)
- addEventHandler("buyPaintjob", getRootElement(), function(_ARG_0_, _ARG_1_)
- if _ARG_0_ == "success" then
- if _ARG_1_ then
- originalPaintjob = _ARG_1_
- end
- exports.sas_paintjob:applyPaintJob(_ARG_1_, true)
- startBuyProgress("paint", "Fest\195\169s...")
- elseif _ARG_0_ == "failed" then
- end
- buyingInProgress = false
- end)
- addEvent("buyHeadLight", true)
- addEventHandler("buyHeadLight", getRootElement(), function(_ARG_0_, _ARG_1_)
- if _ARG_0_ == "success" then
- if _ARG_1_ then
- originalHeadLight = _ARG_1_
- end
- exports.sas_headlight:applyHeadLight(_ARG_1_, true)
- startBuyProgress("newpart", "Felszerel\195\169s...")
- elseif _ARG_0_ == "failed" then
- end
- buyingInProgress = false
- end)
- addEvent("buyColor", true)
- addEventHandler("buyColor", getRootElement(), function(_ARG_0_, _ARG_1_, _ARG_2_)
- if _ARG_0_ == "success" then
- if not compareTables(_ARG_1_, vehicleColor) then
- vehicleColor = _ARG_1_
- startBuyProgress("paint", "Fest\195\169s...")
- end
- if not compareTables(_ARG_2_, vehicleLightColor) then
- vehicleLightColor = _ARG_2_
- startBuyProgress("newpart", "Izz\195\179 cser\195\169je...")
- end
- elseif _ARG_0_ == "failed" then
- end
- buyingInProgress = false
- end)
- addEvent("buyLicensePlate", true)
- addEventHandler("buyLicensePlate", getRootElement(), function(_ARG_0_, _ARG_1_)
- if _ARG_0_ == "success" then
- if _ARG_1_ then
- originalPlate = _ARG_1_
- end
- startBuyProgress("newpart", "Felszerel\195\169s...")
- elseif _ARG_0_ == "failed" then
- end
- togglePlateEdit(false)
- buyingInProgress = false
- end)
- function startBuyProgress(_ARG_0_, _ARG_1_)
- if isElement(_UPVALUE0_) then
- destroyElement(_UPVALUE0_)
- end
- _UPVALUE1_ = getTickCount()
- _UPVALUE2_ = _ARG_1_
- if _ARG_0_ == "newpart" then
- _UPVALUE3_ = 6000
- elseif _ARG_0_ == "paint" then
- _UPVALUE3_ = 8250
- end
- _UPVALUE0_ = playSound("files/sounds/" .. _ARG_0_ .. ".mp3", false)
- end
- function setCameraMatrixRotated(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
- _UPVALUE0_ = {
- _ARG_0_,
- _ARG_1_,
- _ARG_2_,
- _ARG_3_,
- _ARG_4_,
- _ARG_5_
- }
- if not tonumber(camRotation) then
- camRotation = 0
- end
- if not tonumber(camOffsetZ) then
- camOffsetZ = 0
- end
- if not tonumber(_UPVALUE1_) then
- _UPVALUE1_ = 1
- end
- setCameraMatrix(_ARG_3_ + (_ARG_0_ - _ARG_3_) * math.cos((math.rad(camRotation + 10))) - (_ARG_1_ - _ARG_4_) * math.sin((math.rad(camRotation + 10))), _ARG_4_ + (_ARG_0_ - _ARG_3_) * math.sin((math.rad(camRotation + 10))) + (_ARG_1_ - _ARG_4_) * math.cos((math.rad(camRotation + 10))), _ARG_2_ + camOffsetZ, _ARG_3_, _ARG_4_, _ARG_5_, 0, 70 / (_UPVALUE1_ or 1))
- end
- addEventHandler("onClientPreRender", getRootElement(), function()
- if panelState then
- if not tonumber(camRotation) then
- camRotation = 0
- end
- if not tonumber(camOffsetZ) then
- camOffsetZ = 0
- end
- if getKeyState("mouse1") and not _UPVALUE0_ and not true and not isPicking and not isLuminancePicking then
- if not _UPVALUE1_ then
- _UPVALUE1_ = {
- getCursorPosition()
- }
- end
- camRotation = _UPVALUE1_[3] - (getCursorPosition() - _UPVALUE1_[1]) / screenWidth * 270
- if camRotation > 360 then
- camRotation = camRotation - 360
- end
- if camRotation < 0 then
- camRotation = camRotation + 360
- end
- camOffsetZ = _UPVALUE1_[4] + (getCursorPosition() - _UPVALUE1_[2]) / screenHeight * 10
- if camOffsetZ < -2 then
- camOffsetZ = -2
- end
- if camOffsetZ > 2 then
- camOffsetZ = 2
- end
- else
- _UPVALUE1_ = false
- end
- if _UPVALUE2_ and not _UPVALUE0_ then
- _UPVALUE3_ = interpolateBetween(_UPVALUE4_[1], 0, 0, _UPVALUE4_[2], 0, 0, (getTickCount() - _UPVALUE2_) / 150, "InOutQuad")
- if 1 <= (getTickCount() - _UPVALUE2_) / 150 then
- _UPVALUE2_ = false
- end
- end
- if _UPVALUE0_ then
- camRotation, camOffsetZ, _UPVALUE3_ = interpolateBetween(_UPVALUE5_[7], _UPVALUE5_[8], _UPVALUE5_[9], 0, 0, 1, (getTickCount() - _UPVALUE0_) / 600, "InOutQuad")
- if 1 <= (getTickCount() - _UPVALUE0_) / 600 then
- _UPVALUE0_ = false
- _UPVALUE2_ = false
- end
- setCameraMatrixRotated(interpolateBetween(_UPVALUE5_[1], _UPVALUE5_[2], _UPVALUE5_[3], _UPVALUE6_[1], _UPVALUE6_[2], _UPVALUE6_[3], (getTickCount() - _UPVALUE0_) / 600, "InOutQuad"))
- for _FORV_17_ in pairs((getVehicleComponents(vehicleElement))) do
- setVehicleComponentVisible(vehicleElement, _FORV_17_, true)
- end
- if currentLevel and currentSubLevel and selectionLevel == 2 and tuningContainer[currentLevel].subMenu[currentSubLevel] and tuningContainer[currentLevel].subMenu[currentSubLevel].hideComponent then
- setVehicleComponentVisible(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].hideComponent, false)
- end
- else
- setCameraMatrixRotated(unpack(_UPVALUE6_))
- if currentLevel and currentSubLevel and selectionLevel == 2 and tuningContainer[currentLevel].subMenu[currentSubLevel] then
- end
- if tuningContainer[currentLevel].subMenu[currentSubLevel].hideComponent and not _UPVALUE7_ then
- setVehicleComponentVisible(vehicleElement, tuningContainer[currentLevel].subMenu[currentSubLevel].hideComponent, false)
- else
- for _FORV_8_ in pairs((getVehicleComponents(vehicleElement))) do
- setVehicleComponentVisible(vehicleElement, _FORV_8_, true)
- end
- end
- end
- end
- end)
- function shallowcopy(_ARG_0_)
- if type(_ARG_0_) == "table" then
- for _FORV_6_, _FORV_7_ in pairs(_ARG_0_) do
- end
- else
- end
- return _ARG_0_
- end
- function changeCamera(_ARG_0_)
- if _UPVALUE0_ == _ARG_0_ then
- return
- end
- if _ARG_0_ == "base" then
- _UPVALUE1_ = shallowcopy(_UPVALUE2_)
- _UPVALUE1_[7] = camRotation
- _UPVALUE1_[8] = camOffsetZ
- _UPVALUE1_[9] = _UPVALUE3_
- _UPVALUE4_ = _UPVALUE5_
- _UPVALUE6_ = getTickCount()
- playSound("files/sounds/cammove.mp3")
- _UPVALUE0_ = _ARG_0_
- elseif _ARG_0_ == "lightpaint" then
- _UPVALUE1_ = shallowcopy(_UPVALUE2_)
- _UPVALUE1_[7] = camRotation
- _UPVALUE1_[8] = camOffsetZ
- _UPVALUE1_[9] = _UPVALUE3_
- _UPVALUE4_ = {
- getElementPosition(vehicleElement) + (0 + (0 - 0) * math.cos((math.rad(getElementRotation(vehicleElement)))) - (10 - 0) * math.sin((math.rad(getElementRotation(vehicleElement))))),
- getElementPosition(vehicleElement) + (0 + (0 - 0) * math.sin((math.rad(getElementRotation(vehicleElement)))) + (10 - 0) * math.cos((math.rad(getElementRotation(vehicleElement))))),
- getElementPosition(vehicleElement)
- }
- _UPVALUE6_ = getTickCount()
- playSound("files/sounds/cammove.mp3")
- _UPVALUE0_ = _ARG_0_
- elseif string.gsub(_ARG_0_, "_excomp", "") and getVehicleComponents(vehicleElement)[string.gsub(_ARG_0_, "_excomp", "")] then
- _UPVALUE1_ = shallowcopy(_UPVALUE2_)
- _UPVALUE1_[7] = camRotation
- _UPVALUE1_[8] = camOffsetZ
- _UPVALUE1_[9] = _UPVALUE3_
- _UPVALUE4_ = {
- getVehicleComponentPosition(vehicleElement, string.gsub(_ARG_0_, "_excomp", ""), "world") + (0 + (componentOffsets[_ARG_0_][1] - 0) * math.cos((math.rad(getElementRotation(vehicleElement)))) - (componentOffsets[_ARG_0_][2] - 0) * math.sin((math.rad(getElementRotation(vehicleElement))))),
- getVehicleComponentPosition(vehicleElement, string.gsub(_ARG_0_, "_excomp", ""), "world") + (0 + (componentOffsets[_ARG_0_][1] - 0) * math.sin((math.rad(getElementRotation(vehicleElement)))) + (componentOffsets[_ARG_0_][2] - 0) * math.cos((math.rad(getElementRotation(vehicleElement))))),
- getVehicleComponentPosition(vehicleElement, string.gsub(_ARG_0_, "_excomp", ""), "world") + componentOffsets[_ARG_0_][3],
- getVehicleComponentPosition(vehicleElement, string.gsub(_ARG_0_, "_excomp", ""), "world") + (0 + (componentOffsets[_ARG_0_][4] - 0) * math.cos((math.rad(getElementRotation(vehicleElement)))) - (componentOffsets[_ARG_0_][5] - 0) * math.sin((math.rad(getElementRotation(vehicleElement))))),
- getVehicleComponentPosition(vehicleElement, string.gsub(_ARG_0_, "_excomp", ""), "world") + (0 + (componentOffsets[_ARG_0_][4] - 0) * math.sin((math.rad(getElementRotation(vehicleElement)))) + (componentOffsets[_ARG_0_][5] - 0) * math.cos((math.rad(getElementRotation(vehicleElement))))),
- getVehicleComponentPosition(vehicleElement, string.gsub(_ARG_0_, "_excomp", ""), "world") + componentOffsets[_ARG_0_][6]
- }
- _UPVALUE6_ = getTickCount()
- playSound("files/sounds/cammove.mp3")
- _UPVALUE0_ = _ARG_0_
- end
- end
- function isCursorWithinArea_Size(_ARG_0_, _ARG_1_, _ARG_2_, _ARG_3_, _ARG_4_, _ARG_5_)
- return _ARG_2_ <= _ARG_0_ and _ARG_0_ <= _ARG_2_ + _ARG_4_ and _ARG_3_ <= _ARG_1_ and _ARG_1_ <= _ARG_3_ + _ARG_5_
- end
- function getCursorPosition()
- if isCursorShowing() then
- return screenWidth * _UPVALUE0_(), screenHeight * _UPVALUE0_()
- else
- return 0, 0
- end
- end
- function thousandsStepper(_ARG_0_)
- while true do
- k = string.gsub(_ARG_0_, "^(-?%d+)(%d%d%d)", "%1 %2")
- if k == 0 then
- break
- end
- end
- return string.gsub(_ARG_0_, "^(-?%d+)(%d%d%d)", "%1 %2")
- end
- function compareTables(_ARG_0_, _ARG_1_)
- if #_ARG_0_ ~= #_ARG_1_ then
- return false
- end
- for _FORV_5_ = 1, #_ARG_0_ do
- if _ARG_0_[_FORV_5_] ~= _ARG_1_[_FORV_5_] then
- return false
- end
- end
- return _FOR_
- end
Advertisement
Add Comment
Please, Sign In to add comment