Jump to content

Need a help!


Scripting

Recommended Posts

Ok my exemple that work??

the xml file:

60

60

tab

1

in client-side:

function ClientResourceStart () 
text1 = guiGetText(edit1) 
xmlRootTree = xmlLoadFile ( "userSettings.xml" ) 
if xmlRootTree then 
xmlNodeSetValue (xmlCreateChild ( xmlHudBranch, "IconSizeX"), "" .. text1 .. "" ) 
end 
addEventHandler ( "onClientResourceStart", root, ClientResourceStart ) 

Link to comment

You can at least show an example, Solidsnaka:

text    = guiCreateEdit      ( 500, 500, 100, 70, '', false ); 
button  = guiCreateButton    ( 650, 500, 80, 80, 'Get', false ); 
  
addEventHandler ( 'onClientGUIClick', root, 
    function ( ) 
        if ( source == button ) then 
            local text1 = guiGetText ( text ); 
            local fText = xmlCreateFile ( 'test.xml', 'root' ); 
            local child = xmlCreateChild ( fText, 'myText' ); 
            xmlNodeSetValue ( child, tostring ( text1 ) ); 
            xmlSaveFile ( fText ); 
        end 
    end 
) 

This will create a edit and a button, when you press the button, it will get edit text, create a xml file with a 'root' node and create a new child 'myText' and set his text to edit text then save the file and end.

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...