Moderators IIYAMA Posted March 24, 2013 Moderators Share Posted March 24, 2013 I have a problem with manage flags. After I store them in a table they got changed to a number and I can't use them any more. Even if I change them to a string, I also have to change them back to a number to use them again. addEventHandler( "onResourceStart", resourceRoot, function () flagSetInData(33,1,0x000010) end) local flagState = {"pro","std","poor"} function flagSetInData(weapon,state,flag) setWeaponProperty(weapon,flagState[state],flag) end Bad argument @ 'setWeaponProperty' [Expected weapon-property at argument 3, got number '32'] Link to comment
ixjf Posted March 24, 2013 Share Posted March 24, 2013 Lua assumes 0x000010 is a number (it's the hexadecimal value of 16). I don't know if there is any other way to use 0x000010 in a table without converting it to a string, sorry for not helping much. Link to comment
Moderators IIYAMA Posted March 24, 2013 Author Moderators Share Posted March 24, 2013 Even if I write it like this: local A= 0x000010 it will lose it's correct value. Link to comment
ixjf Posted March 24, 2013 Share Posted March 24, 2013 (edited) Sure, as I said above, '0x000010' is a hexadecimal value (its the HEX value of 16). Edited March 28, 2013 by Guest Link to comment
DiSaMe Posted March 24, 2013 Share Posted March 24, 2013 0x000010 is a number. 0x000010 is 16. Debugscript clearly says what the problem is. You missed the property name (should be "flags") in your case and used the value (which should be the 4th argument) in its place. Link to comment
Moderators IIYAMA Posted March 24, 2013 Author Moderators Share Posted March 24, 2013 O_O whops.... thank you, my fail 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