Mohamed Posted September 28, 2014 Share Posted September 28, 2014 وشكر GridList ل refresh السلام عليكم شباب ابي كود يعمل Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 بـــكل سهولة سوي كودكـ اللي يحط الاشياء يعني مثلا اللاعبين سوهـ بفنكشن function Refreshlist ( ) end Refreshlist ( ) ويوم يضغط الزر او متى ما تبي اتصل بالفنكشن Link to comment
فاّرس Posted September 28, 2014 Share Posted September 28, 2014 guiGridListClear مع استخدام Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 شي اكيد لانه بالاصل الفنكشن موجود عشان يمسح اول شي يعني بس ياخذ كودهـ ويحطه ويسوي اتصال بالفنكشن . Link to comment
Mohamed Posted September 28, 2014 Author Share Posted September 28, 2014 يعني يصير كدا GUIEditor.button[60] = guiCreateButton(565,80,130,40,"Refresh",false,GUIEditor.window[1]) setElementData( GUIEditor.button[60], 'aButton',GUIEditor.button[60] ) addEventHandler( 'onClientGUIClick',GUIEditor.button[60], aRefreshList, false ) function aRefreshList( ) guiSetEnabled( getElementData( GUIEditor.button[60], 'aButton' ) , false ) guiGridListClear( GUIEditor.gridlist[1] ) setTimer( guiSetEnabled, 4000, 1, getElementData( GUIEditor.button[60], 'aButton'), true ) end Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 مدري وش جالس تسوي بس شيل كودكـ حق اللي يحط الاشياء باللستة وحطه بالفنكشن وبس وقولنا وش بتسوي بالضبط ؟ بتحط اسماء اللاعبين باللستة ولا ايش Link to comment
Mohamed Posted September 28, 2014 Author Share Posted September 28, 2014 يبقى 4 ثواني حتا يعمل مرة ثانية GridList ل refresh انا بسوي لما اتعمل Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 setTimer isTimer Link to comment
KING-_-HOHO Posted September 28, 2014 Share Posted September 28, 2014 :مثآل بسيط Taple = { { "# ZA7F = ;", "Files/1.png"}, { "KING-_-HOHO", "Files/2.png"}, } function RefreshList( ) guiGridListClear( GridList ) for _,v in ipairs ( Taple ) do local row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, row, 1, v[1], false, false ) guiGridListSetItemData ( GridList, row, 1, v[2] ) end end addEventHandler("onClientGUIClick", root, function () if source == Butt then setTimer ( RefreshList, 4000, 1) end end ) Link to comment
Mr.R Posted September 28, 2014 Share Posted September 28, 2014 (edited) :مثآل بسيط Taple = { { "# ZA7F = ;", "Files/1.png"}, { "KING-_-HOHO", "Files/2.png"}, } function RefreshList( ) guiGridListClear( GridList ) for _,v in ipairs ( Taple ) do local row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, row, 1, v[1], false, false ) guiGridListSetItemData ( GridList, row, 1, v[2] ) end end addEventHandler("onClientGUIClick", root, function () if source == Butt then setTimer ( RefreshList, 4000, 1) end end ) @KING-_-HOHO عندك غلط كودكـ يصير كذا ... Taple = { { "# ZA7F = ;", "Files/1.png"}, { "KING-_-HOHO", "Files/2.png"}, } function RefreshList ( ) -- وظيفه التحديث guiGridListClear( GridList ) for _,v in ipairs ( Taple ) do -- نسوي لوب للقيم الي في الجدول يعني نجلب القيم الي في الجدول local row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, row, 1, v[1], false, false ) guiGridListSetItemData ( GridList, row, 1, v[2] ) end -- اند الفنكشن end -- اند الدو addEventHandler( "onClientguiClick", root, function ( ) -- وظيفه بدون اسم + حدث عند الضغط if ( source == Button ) then -- تحقق من الزر + نحدد السورس if ( isTimer ( Timer ) ) then return end Timer = setTimer ( function ( ) end, RefreshList, 4000, 1 ) -- هنا الوقت انا مخليه بين كل ضغطه وضغطه اربع ثواني end -- اند الفنكشن end -- اند الاف @# ZA7F = ; مثل ماقال تستخدم setTimer isTimer ==[ كان عندي غلط شوفوه اخر تعليق لي صلحته ]== وسلام : ) Edited October 2, 2014 by Guest Link to comment
فاّرس Posted September 28, 2014 Share Posted September 28, 2014 يا سساتر شمسوي في سطر 18 ؟ وناقصك قوس , والاند قبل الاخير للشرط والاخير للنفكشن . كوده صحيح بس ناقصه يتحقق اذا التايمر موجود ما يسويه مره ثانيه ... Link to comment
Mohamed Posted September 28, 2014 Author Share Posted September 28, 2014 انا ابي اسوي رفراش لهذ addEvent("addserial",true) addEventHandler("addserial",root, function(serial,name,reason,i) guiGridListAddRow(aGridlist) guiGridListSetItemText(aGridlist, i, 1, name, false, false) guiGridListSetItemText(aGridlist, i, 2, serial, false, false) guiGridListSetItemText(aGridlist, i, 3, reason, false, false) end) Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 عطني التريقر اللي من كلنت لسيرفر . Link to comment
Mohamed Posted September 28, 2014 Author Share Posted September 28, 2014 --client-- addEvent("addserial",true) addEventHandler("addserial",root, function(serial,name,reason,i) guiGridListAddRow(aGridlist) guiGridListSetItemText(aGridlist, i, 1, name, false, false) guiGridListSetItemText(aGridlist, i, 2, serial, false, false) guiGridListSetItemText(aGridlist, i, 3, reason, false, false) end) --Server--- addEvent("getall",true) addEventHandler("getall",root,function() for i,v in ipairs ( getSerials() ) do triggerClientEvent(source,"addserial",source,v.serial,v.name,v.reason,i) end end) Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 function Refreshlist ( ) triggerServerEvent ( "getall", localPlayer ) end Link to comment
KING-_-HOHO Posted September 28, 2014 Share Posted September 28, 2014 وين احطهم بآي مكآن يعجبك تنويه: آنتبه تحطه دآخل فنكشن آخر Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 بس سوي اتصال بالفنكشن يوم تبي تحدث اللستة . Link to comment
Mohamed Posted September 28, 2014 Author Share Posted September 28, 2014 Gridlist بس انا قتلك لما اضغط على الزر يعمل رفراش لل Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 طيب سوي يوم يضغط الزر يتصل بالفنكشن اللي عطيتك هو وبس . Link to comment
Mohamed Posted September 28, 2014 Author Share Posted September 28, 2014 هيك function Refreshlist ( ) if ( source == GUIEditor.button[60] ) then triggerServerEvent ( "getall", localPlayer ) end end Link to comment
#DRAGON!FIRE Posted September 28, 2014 Share Posted September 28, 2014 function Refreshlist ( ) triggerServerEvent ( "getall", localPlayer ) end addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == GUIEditor.button[60] ) then Refreshlist ( ) end 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