Hero192
Members-
Posts
512 -
Joined
-
Last visited
Everything posted by Hero192
-
It returns with the same results ,any way? because it's possible im just out of experiences thats why
-
Anyone can give me a hand on that?
-
Anyone??? im stuck on this problem please understand my situation
-
I tried to debug the code, When i use the arrows it returns, with INFO: execute: function arr() INFO:scrollPos: -0 Any idea please? function arr(key) outputDebugString("execute: function arr()") -- debug if isElement(sevenShopList) then local scrollPos = guiGridListGetVerticalScrollPosition(sevenShopList) outputDebugString("scrollPos: " .. tostring(scrollPos)) -- debug if key == "arrow_d" then guiGridListSetVerticalScrollPosition(sevenShopList, scrollPos+1) else guiGridListSetVerticalScrollPosition(sevenShopList, scrollPos-1) end else outputDebugString("sevenShopList isn't an element.") -- debug end end bindKey("arrow_d", "down", arr) bindKey("arrow_u", "down", arr)
-
Still doesn't workings without any errors
-
Still doesn't works any other solide idea? Where's the bind of the key? when i try to bind it ,it says bad argument.
-
Still doesn't works,look i added what i did addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) unbindKey("arrow_d", "down",arr ) elseif (source == buy) then if (guiGridListGetSelectedItem (sevenShopList)) then local weapID = guiGridListGetItemText ( sevenShopList, guiGridListGetSelectedItem (sevenShopList) , 1 ) local weapName = guiGridListGetItemText ( sevenShopList, guiGridListGetSelectedItem (sevenShopList) , 2 ) local weapPrice = Weapons[guiGridListGetSelectedItem (sevenShopList)+1][3] local row = guiGridListAddRow ( sevenShopList ) guiGridListSetItemText ( sevenShopList, row, column, message, false, false ) local rowCount = guiGridListGetRowCount ( sevenShopList ) setTimer ( guiGridListSetVerticalScrollPosition, 50, 1, sevenShopList, 100 ) guiSetVisible(window, false) showCursor(false) triggerServerEvent("weapon_Name",getLocalPlayer(),weapID,weapName,weapPrice) end end end) bindKey("arrow_d", "down", function arr() local scrollPos = guiGridListGetVerticalScrollPosition(sevenShopList) guiGridListSetVerticalScrollPosition(sevenShopList, scrollPos+1) end )
-
bindKey("arrow_d", "down", function() local scrollPos = guiGridListGetVerticalScrollPosition(sevenShopList) guiGridListSetVerticalScrollPosition(sevenShopList, scrollPos+1) end ) Should i put what you sent me alone without adding that? local row = guiGridListAddRow ( sevenShopList ) guiGridListSetItemText ( sevenShopList, row, column, message, false, false ) local rowCount = guiGridListGetRowCount ( sevenShopList ) setTimer ( guiGridListSetVerticalScrollPosition, 50, 1, sevenShopList, 100 ) Because it still doesn't works anymore without Errors
-
Yes i knows,i tried your example but i failed thats why i put the code again,to correct me -It dosn't works thats why. window = guiCreateWindow(519*x,214*y,347*x,282*y,"24/7 Shop",false) sevenShopList = guiCreateGridList(11*x,25*y,326*x,218*y,false,window) guiGridListSetSelectionMode(sevenShopList,0) guiGridListAddColumn(sevenShopList,"ID:",0.19,window) guiGridListAddColumn(sevenShopList,"Name:",0.48,window) guiGridListAddColumn(sevenShopList,"Price",0.18,window) buy = guiCreateButton(13*x,249*y,134*x,23*y,"Buy",false,window) reject = guiCreateButton(199*x,249*y,134*x,23*y,"Close ",false,window) guiWindowSetSizable(window,false) guiSetVisible (window,false) local client = getLocalPlayer() Weapons = { {1,1,400}, {2,2,1500}, {5,5,550}, {6,6,700}, {7,7,850}, {8,8,1500}, {9,9,2000}, {10,10,800}, {12,12,800}, {15,15,500} } function DD() for k,v in ipairs (Weapons) do local row = guiGridListAddRow(sevenShopList) guiGridListSetItemText(sevenShopList, row, 1,v[1], false, false) guiGridListSetItemText(sevenShopList, row, 2, getWeaponNameFromID(v[2]), false, false) guiGridListSetItemText (sevenShopList, row, 3, v[3].."$" , false, false) end end function weaponGUI(Weapons) guiGridListClear(sevenShopList) DD() guiSetVisible(window, true) showCursor(true) end addEvent("sevenShopshowGUI",true) addEventHandler("sevenShopshowGUI",root,weaponGUI) addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) -- unbindKey("arrow_up", "down",arr ) -- unbindKey("arrow_down", "down",arl ) elseif (source == buy) then if (guiGridListGetSelectedItem (sevenShopList)) then local weapID = guiGridListGetItemText ( sevenShopList, guiGridListGetSelectedItem (sevenShopList), 1 ) local weapName = guiGridListGetItemText ( sevenShopList, guiGridListGetSelectedItem (sevenShopList), 2 ) local weapPrice = Weapons[guiGridListGetSelectedItem (sevenShopList)][3] local row = guiGridListAddRow ( sevenShopList ) guiGridListSetItemText ( sevenShopList, row, column, message, false, false ) local rowCount = guiGridListGetRowCount ( sevenShopList ) setTimer ( guiGridListSetVerticalScrollPosition, 50, 1, sevenShopList, 100 ) guiSetVisible(window, false) showCursor(false) triggerServerEvent("weapon_Name",getLocalPlayer(),weapID,weapName,weapPrice) end end end) bindKey("arrow_down", "down", function() local scrollPos = guiGridListGetVerticalScrollPosition(sevenShopList) guiGridListSetVerticalScrollPosition(sevenShopList, scrollPos+1) end )
-
Thanks it fixed ,But i have one more problem, its about how to moves/navigate with Arrows in guigridList i tried that but i failed
-
Please GTX,Help me also to fix the row moves with Arrows i stuck here plus the first ID doesn't works when i add guiGridListSetItemText (sevenShopList, row, 3, v[3].."$" , false, false) others working fine exept the first ID,you can read the error window = guiCreateWindow(519*x,214*y,347*x,282*y,"24/7 Shop",false) sevenShopList = guiCreateGridList(11*x,25*y,326*x,218*y,false,window) guiGridListSetSelectionMode(sevenShopList,0) guiGridListAddColumn(sevenShopList,"ID:",0.19,window) guiGridListAddColumn(sevenShopList,"Name:",0.48,window) guiGridListAddColumn(sevenShopList,"Price",0.18,window) buy = guiCreateButton(13*x,249*y,134*x,23*y,"Buy",false,window) reject = guiCreateButton(199*x,249*y,134*x,23*y,"Close ",false,window) guiWindowSetSizable(window,false) guiSetVisible (window,false) local client = getLocalPlayer() Weapons = { {1,1,400}, {2,2,1500}, {5,5,550}, {6,6,700}, {7,7,850}, {8,8,1500}, {9,9,2000}, {10,10,800}, {12,12,800}, {15,15,500} } function DD() for k,v in ipairs (Weapons) do local row = guiGridListAddRow(sevenShopList) guiGridListSetItemText(sevenShopList, row, 1,v[1], false, false) guiGridListSetItemText(sevenShopList, row, 2, getWeaponNameFromID(v[2]), false, false) guiGridListSetItemText (sevenShopList, row, 3, v[3].."$" , false, false) end end function weaponGUI(Weapons) guiGridListClear(sevenShopList) DD() guiSetVisible(window, true) showCursor(true) end addEvent("sevenShopshowGUI",true) addEventHandler("sevenShopshowGUI",root,weaponGUI) addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) -- unbindKey("arrow_up", "down",arr ) -- unbindKey("arrow_down", "down",arl ) elseif (source == buy) then if (guiGridListGetSelectedItem (sevenShopList)) then local weapID = guiGridListGetItemText ( sevenShopList, guiGridListGetSelectedItem (sevenShopList), 1 ) local weapName = guiGridListGetItemText ( sevenShopList, guiGridListGetSelectedItem (sevenShopList), 2 ) local weapPrice = Weapons[guiGridListGetSelectedItem (sevenShopList)][3] local row = guiGridListAddRow ( sevenShopList ) guiGridListSetItemText ( sevenShopList, row, column, message, false, false ) local rowCount = guiGridListGetRowCount ( sevenShopList ) setTimer ( guiGridListSetVerticalScrollPosition, 50, 1, sevenShopList, 100 ) guiSetVisible(window, false) showCursor(false) triggerServerEvent("weapon_Name",getLocalPlayer(),weapID,weapName,weapPrice) end end end) bindKey("arrow_down", "down", function() local scrollPos = guiGridListGetVerticalScrollPosition(sevenShopList) guiGridListSetVerticalScrollPosition(sevenShopList, scrollPos+1) end )
-
Please anyone can give me a hand on that? i see only GTX who's helpful now ..
-
Hey there, I am trying to add "$" in the gridlist with numbers as money,It sends me errors when i click on the first ID,i mean the first row other IDs working fine,but the first ID always gives this Error ERROR: attempt to index field '?' (a nil value) it says the error is in this line local weapPrice = Weapons[guiGridListGetSelectedItem (grid)][3] --Table of weapons: Weapons = { {1,1,400}, --First ID always gives errors {2,2,1500}, {5,5,550}, {6,6,700}, {7,7,850}, {8,8,1500}, {9,9,2000}, {10,10,800}, {12,12,800}, {15,15,500} }
-
I just tried that i saw it in an example,its my first time to use it,any idea? I want someone to correct me to learn from my mistakes.
-
Please i tried that,can anyone correct me?
-
Thanks, i'll try that, please i still have one more error about this EDIT: I tried that but doesn't working .. -Note: "it's my first time i uses guiGridListSetVerticalScrollPosition/guiGridListGetVerticalScrollPosition addEventHandler("onClientGUIClick",root, function () if (source == reject) then guiSetVisible(window, false) showCursor(false) unbindKey("arrow_up", "down",arr ) unbindKey("arrow_down", "down",arl ) elseif (source == buy) then if (guiGridListGetSelectedItem (grid)) then local weapID = guiGridListGetItemText ( grid, guiGridListGetSelectedItem (grid), 1 ) local weapName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem (grid), 2 ) local weapPrice = Weapons[guiGridListGetSelectedItem (grid)][3] local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, column, message, false, false ) local rowCount = guiGridListGetRowCount ( grid ) setTimer ( guiGridListSetVerticalScrollPosition, 50, 1, grid, 100 ) guiSetVisible(window, false) showCursor(false) triggerServerEvent("weapon_Name",getLocalPlayer(),weapID,weapName,weapPrice) end end end) addEventHandler("onClientResourceStart",resourceRoot, function () bindKey("arrow_up", "down",arr ) bindKey("arrow_down", "down",arl ) end)
-
Hey guys,i want move up/down with arrows in the gridList, anyway to do that? What's the functions/events to make it? Thanks in advance
-
It sends me another errors other IDs working fine,but the first ID always gives this Error ERROR: attempt to index field '?' (a nil value) it says the error is in this line local weapPrice = Weapons[guiGridListGetSelectedItem (grid)][3]
-
Workings now,thank you GTX for your time EDIT:still have a problem doesn't selecte/take player money from the first ID
-
It's still doesn't works ,i mean it doesn't take player money@GTX it gives Error about tonumber here's the message: bad argument #2 to 'tonumber' (base out of range)
-
Any idea please?
-
Any idea? --Table in Client side: Weapons = { {1,1,100}, {2,2,1500}, {3,3,1000}, {4,4,10000}, {5,5,122}, {6,6,1222} } Thanks for the ideas, look when i do this type for money table guiGridListSetItemText(gridList, row, 3, v[3].."$" , false, false) i get Error and the player being not able to take money ERROR:server.lua:26:attempt to compare nil with number Line 26 is in server side its the part of 26line if (getPlayerMoney (source) >= tonumber(weapPrice)) then takePlayerMoney (source, tonumber (weapPrice))
-
Any idea? It sends me another errors other IDs working fine,but the first ID always gives this Error ERROR: attempt to index field '?' (a nil value) it says the error is in this line local weapPrice = Weapons[guiGridListGetSelectedItem (grid)][3] --Table of weapons: Weapons = { {1,1,400}, {2,2,1500}, {5,5,550}, {6,6,700}, {7,7,850}, {8,8,1500}, {9,9,2000}, {10,10,800}, {12,12,800}, {15,15,500} }
-
Hey,anyone knows how to handle this problem?
