Hero192 Posted July 24, 2015 Share Posted July 24, 2015 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 Link to comment
GTX Posted July 24, 2015 Share Posted July 24, 2015 bindKey -- "arrow_up", "arrow_down" https://wiki.multitheftauto.com/wiki/Gu ... llPosition https://wiki.multitheftauto.com/wiki/Gu ... llPosition Link to comment
Hero192 Posted July 24, 2015 Author Share Posted July 24, 2015 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) Link to comment
Hero192 Posted July 24, 2015 Author Share Posted July 24, 2015 Please i tried that,can anyone correct me? Link to comment
Castillo Posted July 25, 2015 Share Posted July 25, 2015 Where are the functions "arr" and "arl"? Link to comment
Hero192 Posted July 25, 2015 Author Share Posted July 25, 2015 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. Link to comment
GTX Posted July 25, 2015 Share Posted July 25, 2015 An example: bindKey("arrow_down", "down", function() local scrollPos = guiGridListGetVerticalScrollPosition(grid) guiGridListSetVerticalScrollPosition(grid, scrollPos+1) end ) 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