RegisterServerEvent('sedat:setYouVehicleBySql')
AddEventHandler('sedat:setYouVehicleBySql', function (vehicleProps,youId,model)
local _source = tonumber(youId)
local xPlayer = QBCore.Functions.GetPlayer(_source)
exports.ghmattimysql:execute('INSERT INTO player_vehicles (license, citizenid, plate, vehicle, hash, mods, state, garage) VALUES (@license, @citizenid, @plate, @vehicle, @hash, @mods, @state, @garage)',
{
['@license'] = xPlayer.PlayerData.license,
['@citizenid'] = xPlayer.PlayerData.citizenid,
['@plate'] = vehicleProps.plate,
['@vehicle'] = model,
['@mods'] = '{}',
['@state'] = 0,
['@hash'] = GetHashKey(model)
}, function (rowsChanged)
TriggerClientEvent('QBCore:Notify', _source, 'Verilen Aracın Plakası: '..vehicleProps.plate)
end)
end)
QBCore.Commands.Add("aracver", "[model] [plaka] [id]", {}, false, function(source, args, user) -- name, help, arguments, argsrequired, end sonuna persmission
if source ~= 0 then
local xPlayer = QBCore.Functions.GetPlayer(source)
TriggerClientEvent('sedat:spawnYouVehicleBySql',source,args[1],args[2],args[3])
end
end, "god")