forked from Simnation/Main
resources/[jobs]/[civ]/mh_jobgarage/server/server.lua aktualisiert
This commit is contained in:
parent
cf44412737
commit
94e5ce7ac3
1 changed files with 19 additions and 0 deletions
|
@ -231,4 +231,23 @@ AddEventHandler('mh_jobgarage:GiveAllKeysBack', function(veh)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
TriggerClientEvent('mh_jobgarage:notify', _source, "Schlüsselkasten", "Du hast sämtliche Schlüssel zurückgegeben", "inform")
|
TriggerClientEvent('mh_jobgarage:notify', _source, "Schlüsselkasten", "Du hast sämtliche Schlüssel zurückgegeben", "inform")
|
||||||
|
end)
|
||||||
|
|
||||||
|
QBCore.Functions.CreateCallback('mh_jobgarage:CallOwnerVehicles', function(source, cb)
|
||||||
|
local _source = source
|
||||||
|
local Player = QBCore.Functions.GetPlayer(_source)
|
||||||
|
local pedid = Player.PlayerData.citizenid
|
||||||
|
local veh = {}
|
||||||
|
MySQL.query("SELECT * FROM player_vehicles", {}, function(rs)
|
||||||
|
if rs ~= nil and rs[1] ~= nil then
|
||||||
|
for k, v in pairs(rs) do
|
||||||
|
local keycount = MySQL.query("SELECT * FROM vehicle_keys WHERE owner = ? AND plate = ?", {pedid, v.plate})
|
||||||
|
print("Key Count: "..json.encode(keycount))
|
||||||
|
table.insert(veh, {plate = v.plate, keys = keycount[1].count})
|
||||||
|
end
|
||||||
|
cb(veh)
|
||||||
|
else
|
||||||
|
cb(false)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end)
|
end)
|
Loading…
Add table
Add a link
Reference in a new issue