Jump to content

guiGridListSetItem


pa3ck

Recommended Posts

Posted

Hello there, my problem is that I can't get this damn thing work. Here is the code

  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        jobGui = guiCreateWindow(673, 235, 247, 345, "Jobs ~ pa3ck", false) 
        guiWindowSetSizable(jobGui, false) 
        guiSetVisible(jobGui, false) 
  
        jobGrid = guiCreateGridList(9, 21, 228, 314, false, jobGui) 
        guiGridListAddColumn(jobGrid, "Job:                          Payment:", 0.9) 
        jobTrucker = guiGridListAddRow(jobGrid) 
        guiGridListSetItemText(jobGrid, 0, 1, "Trucker           20 dollars", false, false) 
  
        jobClose = guiCreateButton(14, 277, 200, 27, "Close", false, jobGrid) 
        jobQuit = guiCreateButton(14, 240, 200, 27, "Quit job", false, jobGrid) 
        jobTake = guiCreateButton(14, 203, 200, 27, "Take job", false, jobGrid)     
         
        addEventHandler('onClientGUIClick', jobClose, function() if (source == jobClose) then guiSetVisible(jobGui, false) showCursor(false) end end) 
        addEventHandler('onClientGUIDoubleClick', jobTrucker, function() if (source == jobTrucker) then outputChatBox('Test.') end end) 
    end 
) 
  

Debugscript error: Bad argument at line 27, expected element at argument 2 got number "0". The row itself shows up without a problem, I can even click it, but does not do anything. I can't figure out what's the problem... Any idea?

Posted

There's no line 27 here, so, to which line 27 corresponds to in the code above?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

That's because guiGridListAddRow doesn't return an element, it returns the row number.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You must use:

guiGridListGetSelectedItem 
guiGridListGetItemText 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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