Search the Community
Showing results for tags 'non-convertible'.
-
This error always happens when someone login. WARNING: savesystem\server.lua:56: Expected number, got non-convertible string. This warning may be an error in future versions. [DUP x3] ---------------------------------------------------------------------------------------------------- --- TABLES --- ---------------------------------------------------------------------------------------------------- local antiSpamSave = { } local setting = { } ---------------------------------------------------------------------------------------------------- --- SETTINGS --- ---------------------------------------------------------------------------------------------------- -- Save Data Setting setting.position = not get("position") == "false" and toJSON(split(get("position"), ", ")) or false setting.rotation = tonumber(get("rotation")) or false setting.interior = tonumber(get("interior")) or false setting.dimension = tonumber(get("dimension")) or false setting.team = tostring(get("team")) or false setting.skin = tonumber(get("skin")) or false --setting.data = not get("elementData") == "false" and split(get("elementData"), ", ") or false -- Other Setting setting.loadOnStartResource = not get("loadOnStartResource") == "false" and true or false setting.saveCommand = not get("saveCommand") == "false" and true or false setting.saveTime = tonumber(get("rotation")) or false ---------------------------------------------------------------------------------------------------- --- CUSTOM EVENTS --- ---------------------------------------------------------------------------------------------------- addEvent("onAccountLoadData", true) addEventHandler("onAccountLoadData", root, function (account) local position = getAccountData(account, "position") or setting.position local rot = getAccountData(account, "rotation") or setting.rotation local int = getAccountData(account, "interior") or setting.interior local dim = getAccountData(account, "dimension") or setting.dimension local teamName = getAccountData(account, "team") or setting.team local skin = getAccountData(account, "skin") or setting.skin local health = getAccountData(account, "health") local armor = getAccountData(account, "armor") local money = getAccountData(account, "money") local wanted = getAccountData(account, "wantedlevel") local clothes = getAccountData(account, "clothes") local stats = getAccountData(account, "stats") local weapons = getAccountData(account, "weapons") --local datas = getAccountData(account, "datas") local x, y, z = unpack(fromJSON(position) or {nil}) local team = teamName and getTeamFromName(teamName) or nil if position then spawnPlayer(source, x, y, z, rot, skin, int, dim, team) end if health then setElementHealth(source, health) end if armor then setPedArmor(source, armor) end if money then setPlayerMoney(source, money) end if wanted then setPlayerWantedLevel(source, wanted) end if (clothes) then removeAllPedClothes(source) for _, clothes in pairs(fromJSON(clothes)) do local type, texture, model = unpack(clothes) addPedClothes(source, type, texture, model) end end if (stats) then for stat, value in pairs(fromJSON(stats)) do setPedStat(source, stat, value) end end if (weapons) and not (isPedDead(source)) then takeAllWeapons(source) for weapon, ammo in pairs(fromJSON(weapons)) do giveWeapon(source, weapon, ammo, true) end end ... ... ...