https://imgur.com/a/8y2NmtO taki blad w db 3
kod:
[code]
pojazdy_dozwolone = {
[567] = true,
[575] = true,
[483] = true,
[534] = true,
}
addEvent("onVehicleTuningMontage", true)
addEventHandler("onVehicleTuningMontage", root, function(plr,veh,czesc,kwota,data)
if getElementData(veh, "vehicle:ownedPlayer") ~= getElementData(plr, "player:sid") then exports.nrpg_interface:showPlayerNotification(plr, "To nie jest tw?j pojazd!", "error", 15000) return end
montuj(plr,veh,czesc,kwota,data)
end)
function montuj(plr,veh,czesc,cena,data)
local id = getElementData(veh, "vehicle:id")
if not id then return end
if getElementData(veh, "vehicle:ownedPlayer") ~= getElementData(plr, "player:sid") then exports.nrpg_interface:showPlayerNotification(plr, "To nie jest tw?j pojazd!", "error", 15000) return end
local result = exports["pystories-db"]:dbSet("SELECT * FROM pystories_vehicles WHERE id=?", id)
if czesc == "MK1" then
if result[1].mk1 ~= 0 then
exports.nrpg_interface:showPlayerNotification(plr, "Posiadasz to ulepszenie", "error")
else
exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET mk1=? WHERE id=?", 1, id)
takePlayerMoney(plr, cena)
exports.nrpg_interface:showPlayerNotification(plr, "Zamontowano MK1. Pobrano "..cena.." PLN", "success"... |