Karuzo Posted February 3, 2014 Posted February 3, 2014 Hey Guys, as the title says i have a problem with guiGridListGetItemText. It says bad argument at line 39 with guiGridListGetItemText expected number . Code: Para.window[1] = guiCreateWindow(left, top, windowWidth, windowHeight, "Para Gönderme Paneli", false) guiWindowSetSizable(Para.window[1], false) guiWindowSetMovable(Para.window[1], false) guiSetVisible(Para.window[1],false) guiSetAlpha(Para.window[1], 1.00) Para.gridlist[1] = guiCreateGridList(13, 36, 158, 220, false, Para.window[1]) playcol = guiGridListAddColumn(Para.gridlist[1], "Oyuncu", 0.9) guiGridListAddRow(Para.gridlist[1]) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( Para.gridlist[1] ) guiGridListSetItemText ( Para.gridlist[1], row, playcol, string.gsub ( getPlayerName (playeritem), '#%x%x%x%x%x%x','' ), false, false ) end Para.scrollbar[1] = guiCreateScrollBar(137, 0, 21, 220, false, false, Para.gridlist[1]) guiScrollBarSetScrollPosition(Para.scrollbar[1], 100.0) Para.label[1] = guiCreateLabel(185, 60, 45, 18, "Paran:", false, Para.window[1]) guiSetFont(Para.label[1], "default-bold-small") Para.label[2] = guiCreateLabel(240, 60, 133, 18, "", false, Para.window[1]) guiSetFont(Para.label[2], "default-bold-small") Para.label[3] = guiCreateLabel(185, 97, 45, 18, "Miktar:", false, Para.window[1]) guiSetFont(Para.label[3], "default-bold-small") Para.edit[1] = guiCreateEdit(240, 100, 133, 25, "", false, Para.window[1]) Para.button[1] = guiCreateButton(367, 229, 81, 27, "Kapat", false, Para.window[1]) guiSetFont(Para.button[1], "default-bold-small") guiSetProperty(Para.button[1], "NormalTextColour", "FFAAAAAA") Para.button[2] = guiCreateButton(205, 229, 138, 27, "Gönder", false, Para.window[1]) guiSetFont(Para.button[2], "default-bold-small") guiSetProperty(Para.button[2], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", Para.button[2], function() if source == guiGridListGetItemText(Para.gridlist[1],guiGridListGetSelectedItem(Para.gridlist[1])) ~= "Oyuncu sec" then local getComboPlayer = guiGridListGetItemText(Para.gridlist[1]),guiGridListGetSelectedItem(Para.gridlist[1]) local getMoneyToSend = guiGetText(Para.edit[1]) if getComboPlayer and getMoneyToSend then triggerServerEvent("onPlayerReceiveMoney",localPlayer,getComboPlayer,getMoneyToSend) end end end ) hope you can help me .
DNL291 Posted February 3, 2014 Posted February 3, 2014 Line 39, replace with: local getComboPlayer = guiGridListGetItemText(Para.gridlist[1], guiGridListGetSelectedItem(Para.gridlist[1])) Please do not PM me with scripting related question nor support, use the forums instead.
Karuzo Posted February 3, 2014 Author Posted February 3, 2014 Thank you DNL291, now it works Btw another question, i've added a Scrollbar but i don't know if this was necessary. I mean , does this scrollbar appear if i need to go down ? or was it correct that i added it ?
DNL291 Posted February 3, 2014 Posted February 3, 2014 I think if the gridList have many rows/columns, automatically will create a scrollBar Please do not PM me with scripting related question nor support, use the forums instead.
DNL291 Posted February 3, 2014 Posted February 3, 2014 You're welcome. Please do not PM me with scripting related question nor support, use the forums instead.
.:HyPeX:. Posted February 3, 2014 Posted February 3, 2014 I think if the gridList have many rows/columns, automatically will create a scrollBar It does when the specified used space by the script (all rows/columns sumed) is bigger than the aviable. My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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