Skip to content

Commit

Permalink
Merge pull request Qbox-project#48 from zfbx/main
Browse files Browse the repository at this point in the history
Update SQL query for MySQL2 (+config to wipe inv)
  • Loading branch information
GhzGarage authored Sep 13, 2021
2 parents ec9da8b + e0977e9 commit 8844e0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Config = {}

Config.MinimalDoctors = 2
Config.WipeInventoryOnRespawn = true

Config.Locations = {
["checking"] = vector4(308.19, -595.35, 43.29, 0.0),
Expand Down
6 changes: 4 additions & 2 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ AddEventHandler('hospital:server:RespawnAtHospital', function()
for k, v in pairs(Config.Locations["beds"]) do
TriggerClientEvent('hospital:client:SendToBed', src, k, v, true)
TriggerClientEvent('hospital:client:SetBed', -1, k, true)
Player.Functions.ClearInventory()
exports.oxmysql:execute('UPDATE players SET inventory=@inventory WHERE citizenid=@citizenid', {['@inventory'] = json.encode({}), ['@citizenid'] = Player.PlayerData.citizenid})
if Config.WipeInventoryOnRespawn then
Player.Functions.ClearInventory()
exports.oxmysql:execute('UPDATE players SET inventory = ? WHERE citizenid = ?', { json.encode({}), Player.PlayerData.citizenid })
end
Player.Functions.RemoveMoney("bank", Config.BillCost, "respawned-at-hospital")
TriggerEvent('qb-bossmenu:server:addAccountMoney', "ambulance", Config.BillCost)
TriggerClientEvent('QBCore:Notify', src, 'All your possessions have been taken..', 'error')
Expand Down

0 comments on commit 8844e0a

Please sign in to comment.