1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-06-23 20:02:15 +02:00
commit 715c18bb46
3 changed files with 399 additions and 399 deletions

View file

@ -49,7 +49,7 @@ function OpenMenu(vehicles)
local opt = {}
local Player = QBCore.Functions.GetPlayerData()
if Player.job.grade.level == Zone.Chiefrang then
if Player.job.grade.level >= Zone.Chiefrang then
table.insert(opt, {
title = "Fahrzeug Einstellungen",
description = "Fahrzeuge verwalten",

View file

@ -1,5 +1,5 @@
function CheckVehicleOwner(id, plate)
MySQL.query.await("SELECT * FROM player_vehicles WHERE citizenid = ? and plate = ?", {id, plate}, function(rs)
MySQL.query("SELECT * FROM player_vehicles WHERE citizenid = ? and plate = ?", {id, plate}, function(rs)
if rs ~= nil then
return true
else

View file

@ -21,7 +21,7 @@ QBCore.Functions.CreateCallback('mh_jobgarage:AddVehicleToJob', function(source,
local pedid = Player.PlayerData.citizenid
local pedjob = Player.PlayerData.job.name
local isOwner = MySQL.query("SELECT * FROM player_vehicles WHERE citizenid = ? and plate = ?", {pedid, plate})
local isOwner = CheckVehicleOwner(pedid, plate)--MySQL.query("SELECT * FROM player_vehicles WHERE citizenid = ? and plate = ?", {pedid, plate})
local haveKeys = MySQL.query("SELECT * FROM vehicle_keys WHERE owner = ? and plate = ?", {pedid, plate})
if isOwner and haveKeys then