İlk önce merhaba loaf-housing kurdum servera citizen:/scripting/lua/json.lua:397: bad argument #1 to 'strfind' (string expected, got nil) hatası alıyorum acaba sorun nerededir?
Hatayı Aldığım yer burası :
RegisterServerEvent('loaf_housing:enterHouse')
AddEventHandler('loaf_housing:enterHouse', function(id)
local src = source
local xPlayer = ESX.GetPlayerFromId(src)
MySQL.Async.fetchAll("SELECT * FROM users WHERE identifier = @identifier", {['@identifier'] = xPlayer.identifier}, function(result)
local house = json.decode(result[1].house)
local furniture = json.decode(result[1]['bought_furniture'])
if house.houseId == id then
for k, v in pairs(Config.HouseSpawns) do
if not v['taken'] then
TriggerClientEvent('loaf_housing:spawnHouse', xPlayer.source, v['coords'], furniture)
instances[src] = {['id'] = id, ['owner'] = src, ['coords'] = v['coords'], ['housespawn'] = k, ['players'] = {}}
instances[src]['players'][src] = src
houses[id] = src
v['taken'] = true
return
end
end
else
print(('There seems to be some kind of error in the script "%s", #%s tried to enter house %s but he/she doesn\'t own house #%s.'):format(GetCurrentResourceName(), xPlayer.identifier, id, id))
end
end)
end)