Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Answered [FIXED] Qb-Police Garage System is Not Save the SQL Table

bl4ckhatx

Developer
Joined
Nov 17, 2021
Messages
41
Solutions
1
Reaction score
52
Points
241
Location
Turkey
Hello, this sql request (normally is work manuel phpmyadmin) is add table on player_vehicles.
What want to, I use QB-PoliceJob the police garages is not save of SQL DB, this code basicly usage click to spawn. Want to save because maybe some Pd player is like the customize the car or upgrade the vehicle on benny's mechanic ( only police job ).





I try it 3 Methods thats;
<hr>
MySQL.Async.execute("INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, state) VALUES (@license,@citizenid,@vehicle,@hash,@mods,@plate,@state)", {['@license'] = Player.PlayerData.license, ['@citizenid'] = Player.PlayerData.citizenid, ['@vehicle'] = vehmodel, ['@hash'] = hash, ['@mods'] = "{}", ['@plate'] = newplate, ['@state'] = "0"})

QBCore.Functions.ExecuteSql(false, "INSERT INTO `player_vehicles` (`id`, `license`, `citizenid`, `vehicle`, `hash`, `mods`, `plate`, `fakeplate`, `garage`, `fuel`, `engine`, `body`, `state`, `depotprice`, `drivingdistance`, `status`, `balance`, `paymentamount`, `paymentsleft`, `financetime`, `modifications`, `posX`, `posY`, `posZ`, `rotX`, `rotY`, `rotZ`, `lastUpdate`) VALUES (NULL, Player.PlayerData.license, Player.PlayerData.citizenid, vehmodel, hash, '{}', newplate, NULL, NULL, '100', '1000', '1000', '0', '0', NULL, NULL, '0', '0', '0', '0', '', '', '', '', '', '', '', '0')")
exports.oxmysql:insert("INSERT INTO `player_vehicles` (`id`, `license`, `citizenid`, `vehicle`, `hash`, `mods`, `plate`, `fakeplate`, `garage`, `fuel`, `engine`, `body`, `state`, `depotprice`, `drivingdistance`, `status`, `balance`, `paymentamount`, `paymentsleft`, `financetime`, `modifications`, `posX`, `posY`, `posZ`, `rotX`, `rotY`, `rotZ`, `lastUpdate`) VALUES (NULL, Player.PlayerData.license, Player.PlayerData.citizenid, vehmodel, hash, '{}', newplate, NULL, NULL, '100', '1000', '1000', '0', '0', NULL, NULL, '0', '0', '0', '0', '', '', '', '', '', '', '', '0')")

Sorry My English!
 
Last edited:
Solution
bl4ckhatx

bl4ckhatx, thank you for providing the solution.

Problem has fixed!
1641939559601.png


This insert is work and add the table

exports.oxmysql:insert("INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, state) VALUES (:license, :citizenid, :vehicle, :hash, :mods, :plate, :state)", { license = Player.PlayerData.license, citizenid = Player.PlayerData.citizenid, vehicle = vehmodel, hash = hash, mods = '{}', plate = newplate, state = '0', })

bl4ckhatx

Developer
Joined
Nov 17, 2021
Messages
41
Solutions
1
Reaction score
52
Points
241
Location
Turkey
Problem has fixed!
1641939559601.png


This insert is work and add the table

exports.oxmysql:insert("INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, state) VALUES (:license, :citizenid, :vehicle, :hash, :mods, :plate, :state)", { license = Player.PlayerData.license, citizenid = Player.PlayerData.citizenid, vehicle = vehmodel, hash = hash, mods = '{}', plate = newplate, state = '0', })
 
Solution
Top