MA[S]RIY Posted July 14, 2017 Author Share Posted July 14, 2017 ؟ والله ي جماعه الموضوع سهل جدا طيب ابي لما اختار شئ من الجريد ليست واضغط ع زر يسوي شئ مثلا: لما اختار اول اختيار في الجريد ليست give واضغط ع زر يعطيني دم Link to comment
Rockyz Posted July 15, 2017 Share Posted July 15, 2017 (edited) تسوي جدول وتحط فيه اسمه الرو table = { {"Health"} } تسوي لوب على جميع محتويات الجدول وتسوي guiGridListAddRow guiGridListSetItemText الحين نجي لما يضغط ع القريد لست يصير شي تستخدم : 'onClientGUIDoubleClick' guiGridListGetSelectedItem guiGridListGetItemText مثال : table = { {'Health'} } grid = guiCreateGridList ( ... ) for k, v in ipairs ( table ) do local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, 1, v[1], false, false ) end addEventHandler ( 'onClientGUIDoubleClick', root, function ( ) if ( source == grid ) then if ( guiGridListGetSelectedItem ( grid ) ~= -1 ) then local textt = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) if ( textt == 'Health' ) then outputChatBox ( 'Health.' ) end end end end ) مثال ثاني اذا ضغطت زر يزود دمك ( طبعا هذا بس مثال ) table = { {'Health1' }, {'Health2' } } grid = guiCreateGridList ( ... ) btn = guiCreateButton ( ... ) for k, v in ipairs ( table ) do local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, 1, v[1], false, false ) end addEventHandler ( 'onClientGUIClick', root, function ( ) if ( source == btn ) then if ( guiGridListGetSelectedItem ( grid ) ~= -1 ) then local textt = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) if ( textt == 'Health1' ) then setElementHealth ( localPlayer, 50 ) elseif ( textt == 'Health2' ) then setElementHealth ( localPlayer, 100 ) end end end end ) Edited July 15, 2017 by #,+( _xiRoc[K]; > 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