Shuubaru Posted November 19, 2016 Posted November 19, 2016 Hi, I got a problem with the "settings" on my script. I set in the meta the following: <settings> <setting name="*skinsPrice" value="2500" group="Price" desc="Set the price of the skins." /> </settings> But when I try to edit the value I got this error: Basically, if I edit one, another setting is created with the value I set, and the old setting is not changed. If I use get() function like this: function saveSkinPrice (skinsResource) if skinsResource ~= getThisResource() then return end local currentSkinPrice = get("skinsPrice") --I use the setElementData to retrieve the value on client side setElementData(resourceRoot, "skins.price", currentSkinPrice ) end addEventHandler("onResourceStart", getRootElement(), saveSkinPrice) function updateSkinPrice(pricesetting, oldprice, newprice) --outputs for testing outputChatBox(pricesetting) outputChatBox(oldprice) outputChatBox(newprice) local currentSkinPrice = get("skinsPrice") setElementData(resourceRoot, "skins.price", currentSkinPrice ) end addEventHandler("onSettingChange", getRootElement(), updateSkinPrice) It retrieve the value from "iG_infernus-skins.skinsPrice" setting, making the setting "skinsPrice" useless. I can only use it to edit the "iG_infernus-skins.skinsPrice" setting, and that doesn't have any sense. Incognito Gaming - Multi gamemode [Shooter/Race/DM/OS/DD/Hunter]: - PVP System. - Kill detection system. - Youtube music system. - Garage - Map cache. -And more...
Gravestone Posted November 19, 2016 Posted November 19, 2016 I don't think you can use resourceRoot as an element? Clan war system http://sh.st/7r4nI
MIKI785 Posted November 19, 2016 Posted November 19, 2016 3 hours ago, Gravestone said: I don't think you can use resourceRoot as an element? Yes you can, it's the root element of the resource, so it is a valid element. Lua Scripter Owner of mshost.cz MTA portal.
Shuubaru Posted November 19, 2016 Author Posted November 19, 2016 bump Any help? I can't fix it yet... I tried everything I know and I didn't find anything on the forum about this, neither in bugs.mtasa.com Incognito Gaming - Multi gamemode [Shooter/Race/DM/OS/DD/Hunter]: - PVP System. - Kill detection system. - Youtube music system. - Garage - Map cache. -And more...
MIKI785 Posted November 19, 2016 Posted November 19, 2016 So youre saying that whenever you edit the setting in admin it doesnt change it but creates a new one instead? Thats really strange and it looks like the bug is in admin. Try changing the resource name so that it doesnt contain a dash (-) character. 1 Lua Scripter Owner of mshost.cz MTA portal.
Shuubaru Posted November 19, 2016 Author Posted November 19, 2016 2 hours ago, MIKI785 said: So youre saying that whenever you edit the setting in admin it doesnt change it but creates a new one instead? Thats really strange and it looks like the bug is in admin. Try changing the resource name so that it doesnt contain a dash (-) character. I deleted the dash character and now it works. Thanks. I didn't expected to have problems with that character, should I send a bug report? Because I didn't see anything about that on bugs.mtasa.com Incognito Gaming - Multi gamemode [Shooter/Race/DM/OS/DD/Hunter]: - PVP System. - Kill detection system. - Youtube music system. - Garage - Map cache. -And more...
LoPollo Posted November 19, 2016 Posted November 19, 2016 (edited) EDIT: nvm, not even sure about what i said lol. THIS COMMENT DOES NOT EXISTS, i must check some things before Edited November 19, 2016 by LoPollo
MIKI785 Posted November 19, 2016 Posted November 19, 2016 3 hours ago, Shuuichi said: I deleted the dash character and now it works. Thanks. I didn't expected to have problems with that character, should I send a bug report? Because I didn't see anything about that on bugs.mtasa.com Well you might, it's not supposed to be happening because dash is a legal character for resource names. It's most likely a bug in admin resource and not MTA itself. But i could test that to be sure. Lua Scripter Owner of mshost.cz MTA portal.
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