I’m using an older script and need some help if possible.
I’ve got almost everything ironed out except this error.
The snippet below is what is inserted into qb-vehicles.
When a player wins a car this is executed. I’m really not sure how to fix it but it seems like a simple fix for someone with a bit of knowledge. I’m unemployed and poor as dirt, I simply can’t afford to pay for a $40 script for the wheel alone, that’s just bonkers. help me ObiWan Kenobi, you’re my only hope! xoxoxo
-- Win car at luckywheel
RegisterNetEvent('qb-vehicleshop:server:luckywheelWin', function(data, carname)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local PlayerData = Player.PlayerData
local vehicle = data
local showCar = carname
local plate = GeneratePlate()
MySQL.Async.insert('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, state, garage) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
PlayerData.license,
PlayerData.citizenid,
carname,
GetHashKey(vehicle),
'{}',
plate,
1,
'casinogarage'
})
TriggerClientEvent('qb-vehicleshop:client:winLuckyWheelVehicle', src, vehicle, plate)
TriggerClientEvent('QBCore:Notify', src, 'Congratulations! Your vehicle can be claimed at the valet near the entrance.', 'success')
end)