- Katılım
- 4 yıl 18 gün
- Mesajlar
- 46
Selamlar değerli forum üyeleri ben bir hata alıyorum yardımcı olur musunuz ?
Eklediğim code :
ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, model, plate)
local xPlayer = ESX.GetPlayerFromId(source)
local modelPrice
for k,v in ipairs(vehicles) do
if model == v.model then
modelPrice = v.price
break
end
end
if modelPrice and xPlayer.getMoney() >= modelPrice then
xPlayer.removeMoney(modelPrice)
exports.ghmattimysql:execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES ( O Owner, @plate, @vehicle)', {
[' O Owner'] = xPlayer.identifier,
['@plate'] = plate,
['@vehicle'] = json.encode({model = GetHashKey(model), plate = plate})
}, function(rowsChanged)
xPlayer.showNotification(_U('vehicle_belongs', plate))
info = {
model = v.model,
plaka = plate,
}
xPlayer.addInventoryItem('vehiclekey', 1, false, info)
cb(true)
end)
else
cb(false)
end
end)
Hata :
Eklediğim code :
ESX.RegisterServerCallback('esx_vehicleshop:buyVehicle', function(source, cb, model, plate)
local xPlayer = ESX.GetPlayerFromId(source)
local modelPrice
for k,v in ipairs(vehicles) do
if model == v.model then
modelPrice = v.price
break
end
end
if modelPrice and xPlayer.getMoney() >= modelPrice then
xPlayer.removeMoney(modelPrice)
exports.ghmattimysql:execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES ( O Owner, @plate, @vehicle)', {
[' O Owner'] = xPlayer.identifier,
['@plate'] = plate,
['@vehicle'] = json.encode({model = GetHashKey(model), plate = plate})
}, function(rowsChanged)
xPlayer.showNotification(_U('vehicle_belongs', plate))
info = {
model = v.model,
plaka = plate,
}
xPlayer.addInventoryItem('vehiclekey', 1, false, info)
cb(true)
end)
else
cb(false)
end
end)
Hata :