Chaos Posted February 12, 2014 Share Posted February 12, 2014 hi, so i want to import animations panel from freeroam and make it open with bind alone is that possible ? function applyAnimation(leaf) if type(leaf) ~= 'table' then leaf = getSelectedGridListLeaf(wndAnim, 'animlist') if not leaf then return end end server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true) end function stopAnimation() server.setPedAnimation(g_Me, false) end wndAnim = { 'wnd', text = 'Set animation', width = 250, x = -20, y = 0.3, controls = { { 'lst', id='animlist', width=230, height=290, columns={ {text='Animation', attr='name'} }, rows={xml='animations.xml', attrs={'name'}}, expandlastlevel=false, onitemdoubleclick=applyAnimation }, {'btn', id='set', onclick=applyAnimation}, {'btn', id='stop', onclick=stopAnimation}, {'btn', id='close', closeswindow=true} } } Link to comment
Castillo Posted February 12, 2014 Share Posted February 12, 2014 No, it would be a lot easier to make your own from scratch. Link to comment
Chaos Posted February 12, 2014 Author Share Posted February 12, 2014 But I don't know how to import animations from xml thing Link to comment
Castillo Posted February 12, 2014 Share Posted February 12, 2014 Use the following functions: xmlLoadFile -- To load the XML files xmlNodeGetChildren -- To get the XML children and a for-loop to loop all the children to add them to the gridlist. Link to comment
Chaos Posted February 12, 2014 Author Share Posted February 12, 2014 So can I use same animations.xml in freeroam to import? Link to comment
Castillo Posted February 12, 2014 Share Posted February 12, 2014 Yes, you can use the same one. Link to comment
Chaos Posted February 12, 2014 Author Share Posted February 12, 2014 I will try and tell you if I got problems Link to comment
Chaos Posted February 12, 2014 Author Share Posted February 12, 2014 i just created this what i should do now ? GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(362, 184, 300, 400, "Animations", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(0.03, 0.08, 0.90, 0.69, true, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Animation", 0.9) GUIEditor.button[1] = guiCreateButton(0.03, 0.80, 0.90, 0.18, "Stop Animation", true, GUIEditor.window[1]) end ) Link to comment
Castillo Posted February 13, 2014 Share Posted February 13, 2014 Well, that's just the GUI, you have to make it load the animations from the XML file using the functions I posted earlier. 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