Jump to content

import animations


Chaos

Recommended Posts

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

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

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