manve1 Posted January 16, 2013 Share Posted January 16, 2013 I have 2 grid's in my script and i'm not sure how i can get if other grid was pressed, if it was then the click would be removed, I need this for a memo. Link to comment
MR.S3D Posted January 16, 2013 Share Posted January 16, 2013 I have 2 grid's in my script and i'm not sure how i can get if other grid was pressed, if it was then the click would be removed, I need this for a memo. show me your grid list Link to comment
manve1 Posted January 16, 2013 Author Share Posted January 16, 2013 why would u need a grid list? As i didn't do anything with it There is: 2 gridlists, 1 memo and i want to make that when i click on one gridlist writing appears in memo (( I know how to make this )) but when i click on the other gui, i need the first one to cancel out it's writing in memo Link to comment
MR.S3D Posted January 16, 2013 Share Posted January 16, 2013 why would u need a grid list? As i didn't do anything with itThere is: 2 gridlists, 1 memo and i want to make that when i click on one gridlist writing appears in memo (( I know how to make this )) but when i click on the other gui, i need the first one to cancel out it's writing in memo addEventHandler("onClientGUIClick", root, function(button, state, absoulteX, absoulteY) if source == button then local grid1 = guiGridListGetSelectedItem(GRid1) local get1 = guiGridListGetItemText(GRid1, grid1, COL1) local grid2 = guiGridListGetSelectedItem(GRid2) local get2 = guiGridListGetItemText(GRid2, grid2, COL2) if get1 == "" then return end if get2 == "" then return end ----اhere your code end end ) Link to comment
manve1 Posted January 16, 2013 Author Share Posted January 16, 2013 this works for me when i click on grid2 then on grid1: click1 = function() local row,col = guiGridListGetSelectedItem ( grid ) local row2,col2 = guiGridListGetSelectedItem ( grid2 ) if ( row == 0 ) and ( col == 1 ) then guiSetText(text,english) elseif ( row == 1 ) and ( col == 1 ) then guiSetText(text,lithuanian) elseif ( row == 2 ) and ( col == 1 ) then guiSetText(text,portugese) elseif ( row == 3 ) and ( col == 1 ) then guiSetText(text,spanish) elseif ( row == 4 ) and ( col == 1 ) then guiSetText(text,italian) elseif ( row == 5 ) and ( col == 1 ) then guiSetText(text,latvian) elseif ( row == 6 ) and ( col == 1 ) then guiSetText(text,polish) elseif ( row2 == 0 ) and ( col2 == 1 ) then guiSetText(text,commands) elseif ( row2 == 1 ) and ( col2 == 1 ) then guiSetText(text,website) elseif ( row2 == 2 ) and ( col2 == 1 ) then guiSetText(text,updates) elseif ( row2 == 3 ) and ( col2 == 1 ) then guiSetText(text,staff) end end addEventHandler('onClientGUIClick',root, click1) But, when i click from grid1 to grid2 it doesn't show grid2, it shows grid1 Link to comment
MR.S3D Posted January 16, 2013 Share Posted January 16, 2013 this works for me when i click on grid2 then on grid1: click1 = function() local row,col = guiGridListGetSelectedItem ( grid ) local row2,col2 = guiGridListGetSelectedItem ( grid2 ) if ( row == 0 ) and ( col == 1 ) then guiSetText(text,english) elseif ( row == 1 ) and ( col == 1 ) then guiSetText(text,lithuanian) elseif ( row == 2 ) and ( col == 1 ) then guiSetText(text,portugese) elseif ( row == 3 ) and ( col == 1 ) then guiSetText(text,spanish) elseif ( row == 4 ) and ( col == 1 ) then guiSetText(text,italian) elseif ( row == 5 ) and ( col == 1 ) then guiSetText(text,latvian) elseif ( row == 6 ) and ( col == 1 ) then guiSetText(text,polish) elseif ( row2 == 0 ) and ( col2 == 1 ) then guiSetText(text,commands) elseif ( row2 == 1 ) and ( col2 == 1 ) then guiSetText(text,website) elseif ( row2 == 2 ) and ( col2 == 1 ) then guiSetText(text,updates) elseif ( row2 == 3 ) and ( col2 == 1 ) then guiSetText(text,staff) end end addEventHandler('onClientGUIClick',root, click1) But, when i click from grid1 to grid2 it doesn't show grid2, it shows grid1 function click1() local row,col = guiGridListGetSelectedItem ( grid ) local row2,col2 = guiGridListGetSelectedItem ( grid2 ) if source == grid then if ( row == 0 ) and ( col == 1 ) then guiSetText(text,english) elseif ( row == 1 ) and ( col == 1 ) then guiSetText(text,lithuanian) elseif ( row == 2 ) and ( col == 1 ) then guiSetText(text,portugese) elseif ( row == 3 ) and ( col == 1 ) then guiSetText(text,spanish) elseif ( row == 4 ) and ( col == 1 ) then guiSetText(text,italian) elseif ( row == 5 ) and ( col == 1 ) then guiSetText(text,latvian) elseif ( row == 6 ) and ( col == 1 ) then guiSetText(text,polish) end elseif source == grid2 then if ( row2 == 0 ) and ( col2 == 1 ) then guiSetText(text,commands) elseif ( row2 == 1 ) and ( col2 == 1 ) then guiSetText(text,website) elseif ( row2 == 2 ) and ( col2 == 1 ) then guiSetText(text,updates) elseif ( row2 == 3 ) and ( col2 == 1 ) then guiSetText(text,staff) end end end addEventHandler('onClientGUIClick',root, click1) 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