Other Languages Moderators Lord Henry Posted March 9, 2017 Other Languages Moderators Share Posted March 9, 2017 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 ... ... ... Link to comment
Ayush Rathore Posted March 10, 2017 Share Posted March 10, 2017 ---------------------------------------------------------------------------------------------------- --- 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 typo, texture, model = unpack(clothes) addPedClothes(source, typo, 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 ... ... ... try this Link to comment
Other Languages Moderators Lord Henry Posted March 10, 2017 Author Other Languages Moderators Share Posted March 10, 2017 6 hours ago, Ayush Rathore said: try this Keep the same error. Link to comment
Ayush Rathore Posted March 11, 2017 Share Posted March 11, 2017 This might work ---------------------------------------------------------------------------------------------------- --- 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 _, cloth in pairs(fromJSON(clothes)) do local typo, texture, model = unpack(cloth) addPedClothes(source, typo, 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 ... ... ... Link to comment
spoty Posted March 11, 2017 Share Posted March 11, 2017 Wasnt it setPedClothes inplace of addPedClothes Link to comment
Ayush Rathore Posted March 11, 2017 Share Posted March 11, 2017 (edited) 1 hour ago, spoty said: Wasnt it setPedClothes inplace of addPedClothes There is no such function make sure what you are typing Edited March 11, 2017 by Ayush Rathore Link to comment
Other Languages Moderators Lord Henry Posted March 13, 2017 Author Other Languages Moderators Share Posted March 13, 2017 On 11/03/2017 at 04:48, Ayush Rathore said: This might work Always the same error. Link to comment
itHyperoX Posted March 13, 2017 Share Posted March 13, 2017 (edited) Long time ago i edited this script, i toke off the "settings.stuff-s", if you want, i can give you. Working without any problem. Edited March 13, 2017 by TheMOG Link to comment
Other Languages Moderators Lord Henry Posted March 13, 2017 Author Other Languages Moderators Share Posted March 13, 2017 1 hour ago, TheMOG said: Long time ago i edited this script, i toke off the "settings.stuff-s", if you want, i can give you. Working without any problem. I am trying to understand the problem so I can fix it when it happens later in other scripts. Link to comment
NeXuS™ Posted March 13, 2017 Share Posted March 13, 2017 Try this: addPedClothes(source, texture, model, type) You are actually writing those args in the wrong sequence. 1 Link to comment
Other Languages Moderators Lord Henry Posted March 13, 2017 Author Other Languages Moderators Share Posted March 13, 2017 (edited) I did not know that this parameter need a sequence. 4 hours ago, Patrik91 said: Try this: addPedClothes(source, texture, model, type) You are actually writing those args in the wrong sequence. No errors...I think this solved the issue! Edited March 13, 2017 by lordhenry Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now