Untitled diff

Created Diff never expires
2 removals
Lines
Total
Removed
Words
Total
Removed
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
30 lines
14 additions
Lines
Total
Added
Words
Total
Added
To continue using this feature, upgrade to
Diffchecker logo
Diffchecker Pro
40 lines
RegisterServerEvent('esx_vehicleshop:setVehicleOwned')
RegisterServerEvent('esx_vehicleshop:setVehicleOwned')
AddEventHandler('esx_vehicleshop:setVehicleOwned', function (vehicleProps)
AddEventHandler('esx_vehicleshop:setVehicleOwned', function (vehicleProps)
local _source = source
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local xPlayer = ESX.GetPlayerFromId(_source)


MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)',
MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)',
{
{
['@owner'] = xPlayer.identifier,
['@owner'] = xPlayer.identifier,
['@plate'] = vehicleProps.plate,
['@plate'] = vehicleProps.plate,
['@vehicle'] = json.encode(vehicleProps)
['@vehicle'] = json.encode(vehicleProps)
},
},
function (rowsChanged)
function (rowsChanged)
TriggerClientEvent('esx:showNotification', _source, _U('vehicle_belongs', vehicleProps.plate))
Citizen.CreateThread(function()
TriggerClientEvent('esx:showNotification', _source, _U('vehicle_belongs', vehicleProps.plate))
Citizen.Wait(2000)
TriggerClientEvent("ls:newVehicle", _source, vehicleProps.plate, nil, nil)
TriggerEvent("ls:addOwnerWithIdentifier", GetPlayerIdentifiers(_source)[1], vehicleProps.plate)
end)
end)
end)
end)
end)


RegisterServerEvent('esx_vehicleshop:setVehicleOwnedPlayerId')
RegisterServerEvent('esx_vehicleshop:setVehicleOwnedPlayerId')
AddEventHandler('esx_vehicleshop:setVehicleOwnedPlayerId', function (playerId, vehicleProps)
AddEventHandler('esx_vehicleshop:setVehicleOwnedPlayerId', function (playerId, vehicleProps)
local xPlayer = ESX.GetPlayerFromId(playerId)
local xPlayer = ESX.GetPlayerFromId(playerId)


MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)',
MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (@owner, @plate, @vehicle)',
{
{
['@owner'] = xPlayer.identifier,
['@owner'] = xPlayer.identifier,
['@plate'] = vehicleProps.plate,
['@plate'] = vehicleProps.plate,
['@vehicle'] = json.encode(vehicleProps)
['@vehicle'] = json.encode(vehicleProps)
},
},
function (rowsChanged)
function (rowsChanged)
TriggerClientEvent('esx:showNotification', playerId, _U('vehicle_belongs', vehicleProps.plate))
Citizen.CreateThread(function()
TriggerClientEvent('esx:showNotification', playerId, _U('vehicle_belongs', vehicleProps.plate))
Citizen.Wait(2000)
TriggerClientEvent("ls:newVehicle", playerId, nil, vehicleProps.plate, nil, nil)
TriggerEvent("ls:addOwnerWithIdentifier", GetPlayerIdentifiers(_source)[1], vehicleProps.plate)
end)
end)
end)
end)
end)