Jump to content

Gridlist problem ( MTA BUG ? )


Recommended Posts

testfunction =  
    function ( )  
     
        gridlist = guiCreateGridList( 0.3328, 0.7825, 0.3211, 0.175, true ) 
        guiGridListSetSortingEnabled ( gridlist, false ) 
         
        c1 = guiGridListAddColumn( gridlist, "Column1", 0.4 ) 
        c2 = guiGridListAddColumn( gridlist, "Column2", 0.2 ) 
        c3 = guiGridListAddColumn( gridlist, "Column3", 0.45 ) 
        --This will be see like this: Column1 Column2 Column3  
  
        local row = guiGridListAddRow ( gridlist ) 
  
guiGridListSetItemText ( gridlist, row, c1g, "test1", false, false ) 
guiGridListSetItemText (gridlist, row, c2g,  "test2", false, false ) 
guiGridListSetItemText ( gridlist, row, c4g,"test3", false, false ) 
  
        guiGridListSetItemData ( gridlist, , row,c1, 15  ) 
        guiGridListSetItemData  (gridlist, , row,c2, 20  ) 
        guiGridListSetItemData  (gridlist, , row,c3, 201  ) 
  
        button = guiCreateButton( 0.6600, 0.8750, 0.05, 0.082, "Execute", true ) 
        addEventHandler ( "onClientGUIClick", button,  
            function ( )  
                local i1, i2 = guiGridListGetSelectedItem ( gridlist ) 
                Here15 = guiGridListGetItemData ( gridlist, i1, 1 ) 
                Here20 = guiGridListGetItemData ( gridlist, i1, 2 ) 
                Here201 = guiGridListGetItemData ( gridlist, i1, 3 ) 
                print( Here15 )  -- print 15 
                print( Here20 )  -- print 20 
                print( Here201 )  -- print 201 
            end 
        ) 
  
    end 

If u do this function again and PUT'n'DROP columns u can change them positions...

And u can choose them number, for example: Column1 Column3 Column2 or Column3 Column2 Column1 etc.

And when code executed you will be showing

for example:

print( Here15 )  -- print 20 
print( Here20 )  -- print 201    
print( Here201 )  -- print 15 

Maybe i bad using item data or mta has bug.

Please, tell me how to fix that, because this is very important for me.

Thanks,

Edited by Guest
Link to comment
testfunction = 
    function ( ) 
    
        gridlist = guiCreateGridList( 0.3328, 0.7825, 0.3211, 0.175, true ) 
        guiGridListSetSortingEnabled ( gridlist, false ) 
        
        c1 = guiGridListAddColumn( gridlist, "Column1", 0.4 ) 
        c2 = guiGridListAddColumn( gridlist, "Column2", 0.2 ) 
        c3 = guiGridListAddColumn( gridlist, "Column3", 0.45 ) 
        --This will be see like this: Column1 Column2 Column3 
  
        local row = guiGridListAddRow ( gridlist ) 
  
        guiGridListSetItemData ( gridlist, row,c1, 15  ) 
        guiGridListSetItemData  (gridlist,row,c2, 20  ) 
        guiGridListSetItemData  (gridlist,row,c3, 201  ) 
  
        button = guiCreateButton( 0.6600, 0.8750, 0.05, 0.082, "Execute", true ) 
        addEventHandler ( "onClientGUIClick", button, 
            function ( ) 
                local i1, i2 = guiGridListGetSelectedItem ( gridlist ) 
                Here15 = guiGridListGetItemData ( gridlist, i1, 1 ) 
                Here20 = guiGridListGetItemData ( gridlist, i1, 2 ) 
                Here201 = guiGridListGetItemData ( gridlist, i1, 3 ) 
                print( tostring(Here15) )  -- print 15 
                print( tostring(Here20) )  -- print 20 
                print( tostring(Here201) )  -- print 201 
            end 
        ) 
  
    end 

Link to comment

THERE IS NO ERROR OR BUG IN MTA IN THE SECTION YOU ARE TALKING ABOUT IS THAT HARD TO UNDERSTAND??

any problem you face is not just "Mta Bug !!!",

did u use test function??, did u add it onClientResourceStart

addEventHandler('onClientResourceStart', resourceRoot, 
function() 
testfunction 
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...