server/main.lua
-- QB Core code to insert the vehicle to your vehicle table. Can be changed depending on your garage script.
InsertQuery = string.format("INSERT INTO %s (License, CitizenId, Plate, Vehicle, Hash, Garage, State) VALUES (@License, @Owner, @Plate, @Vehicle, @Hash, @Garage, @State)", Config.GarageDatabaseName)
InsertParams = {
["@License"] = GetLicenseIdentifier(src),
['@Owner'] = PlayerIdentifier,
['@Plate'] = data.carplate,
['@Vehicle'] = data.hash,
['@Hash'] = GetHashKey(data.hash),
['@Garage'] = nil,
['@State'] = 0
}
-- ESX code to insert the vehicle to your vehicle table. Can be changed depending on your garage script.
InsertQuery = string.format("INSERT INTO owned_vehicles (Owner, Plate, Vehicle, Type, Stored, Parking) VALUES (@Owner, @Plate, @Vehicle, @Type, @Stored, @Parking)", Config.GarageDatabaseName)
InsertParams = {
['@Owner'] = PlayerIdentifier,
['@Plate'] = data.carplate,
['@Vehicle'] = data.hash,
['@Type'] = "car",
['@Stored'] = 1,
['@Parking'] = data.Coor and json.encode(data.Coor) or nil
}
Last updated