silnik20 = 500000 -- Kwota za tuning cz??ci PLN
silnik25 = 750000
silnik35 = 1220000
zawieszeniePneu = 180000
drzwiDoGory = 100000
MarkerTuning = createMarker( -2528.73,-31.47,25.62-3, "cylinder", 3.15, 25, 213, 15, 140)
Motocykle = {
[581] = true,
[509] = true,
[481] = true,
[468] = true,
[586] = true,
[448] = true,
[522] = true,
[461] = true,
[462] = true,
[463] = true,
[510] = true,
[521] = true,
}
function TuningMarker(el,md)
if not md or getElementType(el) ~= "player" then return end
if not getPedOccupiedVehicle(el) then
outputChatBox("✘ Wejd? do pojazdu!",el, 255, 0, 0)
return
end
local veh = getPedOccupiedVehicle(el)
if Motocykle[getElementModel(veh)] then
outputChatBox("✘ Nie mo?esz zamontowa? ulepszenia do motocyklu!",el, 255, 0, 0)
return
end
triggerClientEvent(el, "PokazGuiTuning", resourceRoot)
setMarkerColor (MarkerTuning, 255, 0, 0, 145 )
end
addEventHandler( "onMarkerHit", MarkerTuning, TuningMarker)
addEventHandler("onMarkerLeave", MarkerTuning, function(el, md)
if not md or getElementType(el) ~= "player" then return end
setMarkerColor (MarkerTuning, 25, 213, 15, 145)
end)
addEvent("Pojemnosc20", true)
addEventHandler("Pojemnosc20", root, function()
if getPlayerMoney(source) < silnik20 then
outputChatBox("✘ Nie posiadasz tyle pieni?dzy!", source, 255, 0, 0)
return
end
takePlayerMoney(source,silnik20)
local vehicle = getPedOccupiedVehicle(source)
setElementData (vehicle, "Pojemnosc:silnika", "2.0cm3")
outputChatBox("✔ Zamontowa?e? pojemno?? 2.0cm3!", source, 255, 255, 255)
outputChatBox("✔ Wyjdz z pojazdu, aby pojemno?? si? wczyta?a.", source, 255, 255, 255)
end)
addEvent("Pojemnosc25", true)
addEventHandler("Pojemnosc25", root, function()
if getPlayerMoney(source) < silnik25 then
outputChatBox("✘ Nie posiadasz tyle pieni?dzy!", source, 255, 0, 0)
return
end
takePlayerMoney(source,silnik25)
local vehicle = getPedOccupiedVehicle(source)
setElementData (vehicle, "Pojemnosc:silnika", "2.5cm3")
outputChatBox("✔ Zamontowa?e? pojemno?? 2.5cm3!", source, 255, 255, 255)
outputChatBox("✔ Wyjdz z pojazdu, aby pojemno?? si? wczyta?a.", source, 255, 255, 255)
end)
addEvent("Pojemnosc35", true)
addEventHandler("Pojemnosc35", root, function()
if getPlayerMoney(source) < silnik35 then
outputChatBox("✘ Nie posiadasz tyle pieni?dzy!", source, 255, 0, 0)
return
end
takePlayerMoney(source,silnik35)
local vehicle = getPedOccupiedVehicle(source)
setElementData (vehicle, "Pojemnosc:silnika", "3.5cm3")
outputChatBox("✔ Zamontowa?e? pojemno?? 3.5cm3!", source, 255, 255, 255)
outputChatBox("✔ Wyjdz z pojazdu, aby pojemno?? si? wczyta?a.", source, 255, 255, 255)
end)
addEvent("DodajZawieszenie", true)
addEventHandler("DodajZawieszenie", root, function()
if getPlayerMoney(source) < zawieszeniePneu then
outputChatBox("✘ Nie posiadasz tyle pieni?dzy!", source, 255, 0, 0)
return
end
takePlayerMoney(source,zawieszeniePneu)
local vehicle = getPedOccupiedVehicle(source)
setElementData (vehicle, "Zawieszenie:Pneumatyczne", "Tak")
outputChatBox("✔ Zamontowa?e?/a? zawieszenie pneumatyczne!", source, 255, 255, 255)
end)
addEvent("ZdemontujZawieszenie", true)
addEventHandler("ZdemontujZawieszenie", root, function()
local vehicle = getPedOccupiedVehicle(source)
setElementData (vehicle, "Zawieszenie:Pneumatyczne", "Nie")
setVehicleHandling(vehicle, "suspensionLowerLimit", getOriginalHandling(getElementModel(vehicle))["suspensionLowerLimit"])
end)
addEvent("DodajDrzwiDoGory", true)
addEventHandler("DodajDrzwiDoGory", root, function()
if getPlayerMoney(source) < drzwiDoGory then
outputChatBox("✘ Nie posiadasz tyle pieni?dzy!", source, 255, 0, 0)
return
end
takePlayerMoney(source,drzwiDoGory)
local vehicle = getPedOccupiedVehicle(source)
setElementData (vehicle, "vehicle:drzwidogury", "Tak")
setElementData (vehicle, "tuning.lsdDoor", true)
outputChatBox("✔ Zamontowa?e?/a? drzwi otwieraj?ce si? do g?ry!", source, 255, 255, 255)
end)
addEvent("ZdemontujDrzwiDoGory", true)
addEventHandler("ZdemontujDrzwiDoGory", root, function()
local vehicle = getPedOccupiedVehicle(source)
setElementData (vehicle, "vehicle:drzwidogury", "Nie")
setElementData (vehicle, "tuning.lsdDoor", false)
end)