Jump to content

ComboBox


RenanPG

Recommended Posts

How can i set a combo box on freeroam gui?

I created only this, but it work on window, i want to show it on a guiComboBox, but i don't know how it works.

--------------------------- 
-- Worlds 
--------------------------- 
--------------------------------------------------------------------- 
  
function setWorld( leaf ) 
    server.setElementDimension( g_Me, leaf.dimension ) 
    local vehicle = getPedOccupiedVehicle( g_Me ) 
    if vehicle then 
        server.setElementDimension( vehicle, leaf.dimension ) 
        --This will set the dimension for everyone in the vehicle. 
        --[[for i=0,getVehicleMaxPassengers( vehicle ) do 
            local player = getVehicleOccupant( vehicle, i ) 
            if player and player ~= g_Me then 
                server.setElementDimension( player, leaf.dimension ) 
            end 
        end]] 
    end 
    setPlayerPosition( leaf.posX, leaf.posY, leaf.posZ + 1 ) 
    setFarClipDistance( leaf.farclip ) 
    -- For testing. 
    errMsg('x = ' ..leaf.posX..', y = ' ..leaf.posY..', z = ' ..leaf.posZ..'.') 
    errMsg('Farclip = ' ..leaf.farclip..', dimension = ' ..leaf.dimension..'.') 
    errMsg('You are now in ' ..leaf.name..'.') 
    -- 
    closeWindow( wndSetWorld ) 
end 
  
wndSetWorld = { 
    'wnd', 
    text = 'Set World', 
    width = 250, 
    controls = { 
        { 
            'lst', 
            id = 'world', 
            width = 230, 
            height = 300, 
            columns = { 
                { text = 'Multi Worlds', attr = 'name' } 
            }, rows = { xml = 'worlds.xml', attrs = { 'name', 'posX', 'posY', 'posZ', 'farclip', 'dimension' } }, 
            onitemdoubleclick = setWorld 
        }, 
        {'btn', id='close', closeswindow=true} 
    } 
} 
  

type="world"> 
    "Freeroam" posX="0" posY="0" posZ="0" farclip="0" dimension="0"/> 
    "Deathmatch" posX="0" posY="0" posZ="0" farclip="0" dimension="1"/> 
    "Zombies" posX="0" posY="0" posZ="0" farclip="0" dimension="2"/> 

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