Stranger Posted August 9, 2014 Share Posted August 9, 2014 hi there, i'm tring to make when someone click on the checkbox, if it's true it saves in the xml 'true' if it's false it saves in the xml 'false' but i got this error: client.lua:154: Bad argument @ 'guiCheckBoxSetSelected' [Expected bool at argument 2, got string 'true'] this error shows when i start the mode. addEventHandler("onClientResourceStart",resourceRoot, function ( ) local state = loadSettingsFromXML() guiCheckBoxSetSelected (save2, state) end ) so help please. Link to comment
Anubhav Posted August 9, 2014 Share Posted August 9, 2014 I found the error, show me your loadSettingsFromXML. Link to comment
Stranger Posted August 9, 2014 Author Share Posted August 9, 2014 solved. i used this -- By hassan.ksa function toboolean(str) if ( str and type(str) == "string" ) then if ( str == "true" ) then return true else return false end end end really useful. 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