Skip to content

Commit

Permalink
Merge pull request #338 from EinS4ckZwiebeln/patch-01
Browse files Browse the repository at this point in the history
Fix exploitable net events
  • Loading branch information
GhzGarage authored Jan 13, 2024
2 parents 39e2419 + 745f1db commit fe6584e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ end)
-- Events

RegisterNetEvent('qb-garages:server:updateVehicleStats', function(plate, fuel, engine, body)
MySQL.update('UPDATE player_vehicles SET fuel = ?, engine = ?, body = ? WHERE plate = ?', { fuel, engine, body, plate })
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
MySQL.update('UPDATE player_vehicles SET fuel = ?, engine = ?, body = ? WHERE plate = ? AND citizenid = ?', { fuel, engine, body, plate, Player.PlayerData.citizenid })
end)

RegisterNetEvent('qb-garages:server:updateVehicleState', function(state, plate)
MySQL.update('UPDATE player_vehicles SET state = ?, depotprice = ? WHERE plate = ?', { state, 0, plate })
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
MySQL.update('UPDATE player_vehicles SET state = ?, depotprice = ? WHERE plate = ? AND citizenid = ?', { state, 0, plate, Player.PlayerData.citizenid })
end)

RegisterNetEvent('qb-garages:server:UpdateOutsideVehicle', function(plate, vehicleNetID)
Expand Down

0 comments on commit fe6584e

Please sign in to comment.