Xabache Posted January 15, 2015 Posted January 15, 2015 The values account, car and vehicle function in earlier calls and are presumed to do so in the following code which receives only "bad argument #1 to 'ipairs' (table expected got string)" From: function carSpawn () local upgrade = getAccountData (account, "funmodev2-carupg") if (upgrade) then local upgrades = nil local upgrades = {} local upgrades = upgrade for i,v in ipairs (upgrades) do addVehicleUpgrade (vehicle, v) end end From: function carDestroy () setAccountData (account, "funmodev2-carupg", getVehicleUpgrades(car)) But no upgrades result on car spawn. ideas?
Moderators IIYAMA Posted January 15, 2015 Moderators Posted January 15, 2015 setAccountData (account, "funmodev2-carupg", toJSON (getVehicleUpgrades(car))) local upgrades = getAccountData (account, "funmodev2-carupg") if upgrades then for i,v in ipairs (fromJSON(upgrades)) do addVehicleUpgrade (vehicle, v) end end Use LUA tags, pls.
Xabache Posted January 15, 2015 Author Posted January 15, 2015 Works perfect. Nice .gif^... and a Lua tag which i will pls use, means...?
novo Posted January 15, 2015 Posted January 15, 2015 He means using the BBCODE. @ http://i.gyazo.com/bf13a341e59a1518a495f7e09255089c.png [xml][/xml]
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