Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-01-09, 18:41


kerfyn

Hyp3R






Wiek: 25
Na forum: 2880 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

Pomoze kto? Chcia?em przerobi? sobie Tunera i wszystko dzia?a mk trakcje itd ale nie dzia?aj? pojemnosci i cylindry a b??d wyskakuje taki :
s_vehbuy.lua:436: bad argument #28 to 'format' (number expected, got string)


s.lua:387: call: failed to call 'pystories-vehicles:onSaveVehicle' [string "?"]





elements = {}
elements["positions"] = {
    ["Tuning mechaniczny"]={
        marker = {950.78, 1874.22, 10.85},
        cuboid = {950.78, 1874.22, 10.85, 5},
    }
}
--1575.76, -1392.81, 14.02
createBlip(950.78, 1874.22, 10.85, 27,2,0,0,0,0,0,275)--ls

local napis=createElement("text")
setElementData(napis, "name", "Tuning mechaniczny")
setElementPosition(napis, 950.78, 1874.22, 10.85)

for i,v in pairs(elements["positions"]) do
    v.cuboid = ColShape.Sphere(unpack(v.cuboid))
    v.marker = Marker(v.marker[1], v.marker[2], v.marker[3]-1, "cylinder", 5, 0,64,255,0)
    createMarker(950.78, 1874.22, 10.85-4.5, "cylinder", 5, 0,64,255,75)
end

addEvent("UP1", true)
addEventHandler("UP1", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 35000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND mk1=?",getElementData(ccar, "vehicle:id"), "1")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? UP1", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:mk1", "1")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET mk1=? WHERE id=?", "1", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano UP1", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("UP2", true)
addEventHandler("UP2", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 40000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND mk2=?",getElementData(ccar, "vehicle:id"), "2")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? UP2", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:mk2", "1")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET mk2=? WHERE id=?", "1", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano UP2", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("UP3", true)
addEventHandler("UP3", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 50000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND mk3=?",getElementData(ccar, "vehicle:id"), "1")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? UP3", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:mk3", "1")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET mk3=? WHERE id=?", "1", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano UP3", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("AWD", true)
addEventHandler("AWD", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 35000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND naped=?",getElementData(ccar, "vehicle:id"), "AWD")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? AWD", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:naped", "AWD")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET naped=? WHERE id=?", "AWD", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano AWD", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("RWD", true)
addEventHandler("RWD", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 27500
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND naped=?",getElementData(ccar, "vehicle:id"), "RWD")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? RWD", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:naped", "RWD")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET naped=? WHERE id=?", "RWD", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano RWD", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("FWD", true)
addEventHandler("FWD", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 20000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND naped=?",getElementData(ccar, "vehicle:id"), "FWD")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? FWD", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:naped", "FWD")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET naped=? WHERE id=?", "FWD", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano FWD", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("trakcja1", true)
addEventHandler("trakcja1", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 20000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND trakcja=?",getElementData(ccar, "vehicle:id"), "BTX01")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? trakcje BTX01", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:trakcja", "BTX01")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET trakcja=? WHERE id=?", "BTX01", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano trakcje BTX01", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("trakcja2", true)
addEventHandler("trakcja2", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 35000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND trakcja=?",getElementData(ccar, "vehicle:id"), "BTX02")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? trakcje BTX02", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:trakcja", "BTX02")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET trakcja=? WHERE id=?", "BTX02", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano trakcje BTX02", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("trakcja3", true)
addEventHandler("trakcja3", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 50000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND trakcja=?",getElementData(ccar, "vehicle:id"), "BTX03")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? trakcje BTX03", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:trakcja", "BTX03")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET trakcja=? WHERE id=?", "BTX03", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano trakcje BTX03", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("hamulce1", true)
addEventHandler("hamulce1", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 20000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND hamulce=?",getElementData(ccar, "vehicle:id"), "STX01")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? hamulce STX01", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:hamulce", "STX01")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET hamulce=? WHERE id=?", "STX01", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano hamulce STX01", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("hamulce2", true)
addEventHandler("hamulce2", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 30000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND hamulce=?",getElementData(ccar, "vehicle:id"), "STX02")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? hamulce STX02", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:hamulce", "STX02")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET hamulce=? WHERE id=?", "STX02", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano hamulce STX02", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("hamulce3", true)
addEventHandler("hamulce3", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 40000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND hamulce=?",getElementData(ccar, "vehicle:id"), "STX03")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? hamulce STX03", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:hamulce", "STX03")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET hamulce=? WHERE id=?", "STX03", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano hamulce STX03", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("TURBO", true)
addEventHandler("TURBO", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 75000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND turbo=?",getElementData(ccar, "vehicle:id"), "1")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? Turbospr??ark?", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "vehicle:turbo", "1")
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET turbo=? WHERE id=?", "1", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano Turbospr??ark?", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)
    
addEvent("RH", true)
addEventHandler("RH", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 15000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND rh=?",getElementData(ccar, "vehicle:id"), "1")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? Gwintowane zawieszenie", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET rh=? WHERE id=?", "1", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano Gwintowane zawieszenie", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("poj", true)
addEventHandler("poj", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 30000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? ci? na te ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    if getElementData(ccar, "Pojemnosc:silnika") == "1.0" then
    setElementData(ccar, "Pojemnosc:silnika", "1.2")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "1.2" then
    setElementData(ccar, "Pojemnosc:silnika", "1.4")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "1.4" then
    setElementData(ccar, "Pojemnosc:silnika", "1.6")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "1.6" then
    setElementData(ccar, "Pojemnosc:silnika", "1.8")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "1.8" then
    setElementData(ccar, "Pojemnosc:silnika", "2.0")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "2.0" then
    setElementData(ccar, "Pojemnosc:silnika", "2.2")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "2.2" then
    setElementData(ccar, "Pojemnosc:silnika", "2.4")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "2.4" then
    setElementData(ccar, "Pojemnosc:silnika", "2.6")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "2.6" then
    setElementData(ccar, "Pojemnosc:silnika", "2.8")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "2.8" then
    setElementData(ccar, "Pojemnosc:silnika", "3.0")
    cancelEvent()
    elseif getElementData(ccar, "Pojemnosc:silnika") == "3.0" then 
    exports["np-notyfikacje"]:noti("Posiadasz maksymaln? pojemno?c silnika", client, "error")
    cancelEvent()
    return end
    exports["np-notyfikacje"]:noti("Pomy?lnie ulepszy?e?(a?) silnik do pojemno?ci "..getElementData(ccar, "Pojemnosc:silnika").." dm3", client)
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("cylindry", true)
addEventHandler("cylindry", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 50000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? ci? na te ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    if getElementData(ccar, "vehicle:cylindry") == "V2" then
    setElementData(ccar, "vehicle:cylindry", "V4")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:cylindry") == "V4" then
    setElementData(ccar, "vehicle:cylindry", "V6")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:cylindry") == "V6" then
    setElementData(ccar, "vehicle:cylindry", "V8")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:cylindry") == "V8" then 
    exports["np-notyfikacje"]:noti("Posiadasz maksymaln? ilo?? cylindr?w", client, "error")
    cancelEvent()
    return end
    exports["np-notyfikacje"]:noti("Pomy?lnie ulepszy?e?(a?) silnik do "..getElementData(ccar, "vehicle:cylindry").."", client)
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("lpg", true)
addEventHandler("lpg", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 35000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? Ci? aby zakupi? to ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    local qr = exports['pystories-db']:dbGet("SELECT * FROM pystories_vehicles WHERE id=? AND gazzamont=?",getElementData(ccar, "vehicle:id"), "Tak")
    if #qr == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? LPG", client, "error") return end
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    setElementData(ccar, "Zamontowane:LPG", "Tak")
    setElementData(ccar,"gaz", getElementData(ccar,"gaz")+25)
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET gazzamont=? WHERE id=?", "Tak", id)
    exports["np-notyfikacje"]:noti("Pomy?lnie zamontowano LPG", client, "success")
    exports["np-notyfikacje"]:noti("Odstaw pojazd do przechowalni by ulepszenie si? wczyta?o.", client, "info")
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)

addEvent("skret", true)
addEventHandler("skret", getRootElement(), function()
    local hajs = getPlayerMoney(source)
    local ccar = getPedOccupiedVehicle(source)
    local cena = 10000
    
    if getElementData(ccar, "vehicle:ownedPlayer") == getElementData(client, "player:sid") then
    if hajs < cena then exports["np-notyfikacje"]:noti("Nie sta? ci? na te ulepszenie!", client, "error") return end
    local id = getElementData(ccar, "vehicle:id")
    if not id then exports["np-notyfikacje"]:noti("To nie jest pojazd prywatny!", client, "error") return end
    if getElementData(ccar, "vehicle:skret") == "Fabryczny" then
    setElementData(ccar, "vehicle:skret", "MB03")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:skret") == "MB03" then
    setElementData(ccar, "vehicle:skret", "MB06")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:skret") == "MB06" then
    setElementData(ccar, "vehicle:skret", "MB09")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:skret") == "MB09" then
    setElementData(ccar, "vehicle:skret", "MB12")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:skret") == "MB12" then
    setElementData(ccar, "vehicle:skret", "MB15")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:skret") == "MB15" then
    setElementData(ccar, "vehicle:skret", "MB18")
    cancelEvent()
    elseif getElementData(ccar, "vehicle:skret") == "MB18" then 
    exports["np-notyfikacje"]:noti("Posiadasz maksymalny k?t skretu", client, "error")
    cancelEvent()
    return end
    exports["np-notyfikacje"]:noti("Pomy?lnie ulepszy?e?(a?) k?t skr?tu do "..getElementData(ccar, "vehicle:skret").."", client)
    exports["pystories-vehicles"]:onSaveVehicle(ccar)
    takePlayerMoney(source, cena)
    else
        exports["np-notyfikacje"]:noti("To nie jest tw?j pojazd!", client, "error")
    end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
kamilowy
Wysłany: 2020-01-10, 09:02


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wska? ca?y event z linijki 387.
Sprawd? czy argument 28 w linijce 436 jest poprawny.

Postaw piwo autorowi tego posta
 

 
Tagi: tuning :: mechaniczny
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Tuning mechaniczny Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku