SQL Queries

This commit is contained in:
GhzGarage
2021-06-28 11:08:29 -05:00
parent af5c2f9d71
commit cba18337d6
+2 -2
View File
@@ -282,9 +282,9 @@ end)
RegisterServerEvent('QBCore:Command:CheckOwnedVehicle')
AddEventHandler('QBCore:Command:CheckOwnedVehicle', function(VehiclePlate)
if VehiclePlate ~= nil then
QBCore.Functions.ExecuteSql(false, "SELECT * FROM `player_vehicles` WHERE `plate` = '"..VehiclePlate.."'", function(result)
exports.ghmattimysql:execute('SELECT * FROM player_vehicles WHERE plate=@plate', {['@plate'] = VehiclePlate}, function(result)
if result[1] ~= nil then
QBCore.Functions.ExecuteSql(false, "UPDATE `player_vehicles` SET `state` = '1' WHERE `citizenid` = '"..result[1].citizenid.."'")
exports.ghmattimysql:execute('UPDATE player_vehicles SET state=@state WHERE citizenid=@citizenid', {['@state'] = 1, ['@citizenid'] = result[1].citizenid})
TriggerEvent('qb-garages:server:RemoveVehicle', result[1].citizenid, VehiclePlate)
end
end)