pa3ck Posted October 19, 2013 Share Posted October 19, 2013 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? Link to comment
Castillo Posted October 19, 2013 Share Posted October 19, 2013 There's no line 27 here, so, to which line 27 corresponds to in the code above? Link to comment
pa3ck Posted October 19, 2013 Author Share Posted October 19, 2013 Its the 18th line. The one with the onClientGUIDoubleClick Link to comment
Castillo Posted October 19, 2013 Share Posted October 19, 2013 That's because guiGridListAddRow doesn't return an element, it returns the row number. Link to comment
pa3ck Posted October 19, 2013 Author Share Posted October 19, 2013 Oh, okay, thanks for the quick help. Link to comment
Castillo Posted October 19, 2013 Share Posted October 19, 2013 You must use: guiGridListGetSelectedItem guiGridListGetItemText Link to comment
pa3ck Posted October 19, 2013 Author Share Posted October 19, 2013 I'll use that, thanks again! 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