Jump to content

[Help] xml


Stranger

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...