Jump to content

Rockyz

Members
  • Posts

    1,862
  • Joined

  • Days Won

    8

Everything posted by Rockyz

  1. بالنسبة للسؤال الاول الاثنين عادي مايفرق بس في المثال الاول انت حاط e زايدة في البداية وسؤالك الثاني السيرفر سايد هو الي يتخزن على السيرفر نفسه والكلنت تتخزن في ملفات الاعب ادري مافهمت لكن يب
  2. تصحيح بسيط للكود الي فوق ^ function changeGridlistToVehicleNames ( gridlist, columnnum ) if not ( columnnum ) then columnnum = 1 end if not ( tonumber ( columnnum ) ) then columnnum = 1 end if ( gridlist ) then if ( getElementType ( gridlist ) == "gui-gridlist" ) then guiGridListClear ( gridlist ) for i = 411, 611 do if ( getVehicleNameFromModel ( i ) ~= "" ) then guiGridListSetItemText ( gridlist, guiGridListAddRow ( gridlist ), columnnum, getVehicleNameFromModel ( i ), false, false ) end end end end end ______________________________________________________________________________________________________________________________________________ #edit : changeGridlistToVehicleNamesAndIds الوضيفة زي الي فوق بس مع تعديلات بسيطة Source Code : function changeGridlistToVehicleNamesAndIds ( gridlist, sort, columnnum, columnnuma, AZ ) local vehsTable = { }; if not ( columnnum ) then columnnum = 1 end; if not ( columnnuma ) then columnnuma = 2 end; if not ( AZ ) then AZ = "AZ" end; if ( gridlist and tostring ( sort ) and tostring ( AZ ) ) then if ( getElementType ( gridlist ) == "gui-gridlist" ) then guiGridListClear ( gridlist ); for i = 411, 611 do if ( getVehicleNameFromModel ( i ) ~= "" ) then table.insert ( vehsTable, { vehName = getVehicleNameFromModel ( i ), vehID = i } ); end; end; if ( sort == "ID" ) then if ( AZ == "ZA" ) then table.sort ( vehsTable, function ( a, b ) return tonumber ( a["vehID"] ) > tonumber ( b["vehID"] ) end ); else if ( AZ == "AZ" ) then table.sort ( vehsTable, function ( a, b ) return tonumber ( a["vehID"] ) < tonumber ( b["vehID"] ) end ); end; end; else if ( sort == "Name" ) then if ( AZ == "ZA" ) then table.sort ( vehsTable, function ( a, b ) return a["vehName"] > b["vehName"] end ); else if ( AZ == "AZ" ) then table.sort ( vehsTable, function ( a, b ) return a["vehName"] < b["vehName"] end ); end; end; end; end; for _, v in ipairs ( vehsTable ) do row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, columnnum, v["vehName"], false, false ); guiGridListSetItemText ( gridlist, row, columnnuma, tostring ( v["vehID"] ), false, false ); end end; end; end; Syntax : changeGridlistToVehicleNamesAndIds ( element gridList, string sortType [ , int VehicleName columnIndex, int VehicleID columnIndex, string sortAZ ] ) Required Arguments : gridList: القريد ليست sortType: طريقة الترتيب يا بالايدي او بالاسم ( الايدي = "ID",,,, الاسم = "Name" ) Optional Arguments : VehicleName columnIndex : كولمن اسم السيارة ( اذا تركته فاضي بيكون الكولمن 1)ء VehicleID columnIndex : كولمن ايدي السيارة ( اذا تركته فاضي بيكون الكولمن 2 )ء sortAZ : طريقة الترتيب يا "AZ" او "ZA" Example : addEventHandler ( 'onClientResourceStart', root, function ( ) local screenW, screenH = guiGetScreenSize ( ) wnd = guiCreateWindow((screenW - 426) / 2, (screenH - 367) / 2, 426, 367, "EXAMPLE", false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetVisible ( wnd, false ) Grid = guiCreateGridList(22, 40, 373, 292, false, wnd) guiGridListAddColumn(Grid, "#Vehicle name", 0.5) guiGridListAddColumn(Grid, "#Vehicle ID", 0.5) changeGridlistToVehicleNamesAndIds ( Grid, "Name", 1, 2, "AZ" ) end ) bindKey ( 'F7', "down", function ( ) guiSetVisible ( wnd, not guiGetVisible ( wnd ) ) showCursor ( guiGetVisible ( wnd ) ) end ) function changeGridlistToVehicleNamesAndIds ( gridlist, sort, columnnum, columnnuma, AZ ) local vehsTable = { }; if not ( columnnum ) then columnnum = 1 end; if not ( columnnuma ) then columnnuma = 2 end; if not ( AZ ) then AZ = "AZ" end; if ( gridlist and tostring ( sort ) and tostring ( AZ ) ) then if ( getElementType ( gridlist ) == "gui-gridlist" ) then guiGridListClear ( gridlist ); for i = 411, 611 do if ( getVehicleNameFromModel ( i ) ~= "" ) then table.insert ( vehsTable, { vehName = getVehicleNameFromModel ( i ), vehID = i } ); end; end; if ( sort == "ID" ) then if ( AZ == "ZA" ) then table.sort ( vehsTable, function ( a, b ) return tonumber ( a["vehID"] ) > tonumber ( b["vehID"] ) end ); else if ( AZ == "AZ" ) then table.sort ( vehsTable, function ( a, b ) return tonumber ( a["vehID"] ) < tonumber ( b["vehID"] ) end ); end; end; else if ( sort == "Name" ) then if ( AZ == "ZA" ) then table.sort ( vehsTable, function ( a, b ) return a["vehName"] > b["vehName"] end ); else if ( AZ == "AZ" ) then table.sort ( vehsTable, function ( a, b ) return a["vehName"] < b["vehName"] end ); end; end; end; end; for _, v in ipairs ( vehsTable ) do row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, columnnum, v["vehName"], false, false ); guiGridListSetItemText ( gridlist, row, columnnuma, tostring ( v["vehID"] ), false, false ); end end; end; end;
  3. ادري فنكشن قديم لكن للي يبي يختصره كذا : function changeGridlistToVehicleNames ( gridlist, columnnum ) if not ( columnnum or not tonumber ( columnnum ) ) then columnnum = 1 end if ( gridlist ) then if ( getElementType ( gridlist ) == "gui-gridlist" ) then guiGridListClear ( gridlist ) for i = 411, 611 do if ( getVehicleNameFromModel ( i ) ~= "" ) then guiGridListSetItemText ( gridlist, guiGridListAddRow ( gridlist ), columnnum, getVehicleNameFromModel ( i ), false, false ) end end end end end الساينتكس : changeGridlistToVehicleNames ( element gridList [ , int columnIndex ] ) gridList = القريد ليست columnIndex = الكولمن اذا ماحطيت كولمن او حطيت الكولمن سترنق تلقائي الكولمن بيكون 1
  4. انت مخربط بين 2 لا هذا شخص انت ماتعرفه شوف البروفايل حقه __________________________________ المهم كروس ابدعت الصراحة بدون مجاملة
  5. وانا وش قلت لك قلت لك انك استخدمت الاكواد هذلين @@@ : addEventHandler ( "onClientGUIClick", root, function ( ) return source == GUIEditor.button[1] and executeCommandHandler ( "le" ) or source == GUIEditor.button[3] and executeCommandHandler ( "lee" ) or source == GUIEditor.button[4] and executeCommandHandler ( "leee" ) or source == GUIEditor.button[2] and executeCommandHandler ( "leeee" ) or source == GUIEditor.button[6] and executeCommandHandler ( "leeeee" ) or source == GUIEditor.button[5] and executeCommandHandler ( "ws" ) or source == GUIEditor.button[7] and executeCommandHandler ( "sam" ) or source == GUIEditor.button[8] and executeCommandHandler ( "samm" ) end ) بشكل خاطئ عشان كذا قلت لك افهم الاكواد قبل لاتسويها !
  6. عشان كذا ماشتغل انت استخدمت الاكواد بطريقة خاطئة انا مجرد عطيت مثال + وين الكوماندات
  7. ورينا اكوادك عشان نفيدك ! ؟
  8. لو انت فاهم كودي كان سويته بسهولة !
  9. انت ناسخ كودي المفروض تدري وش في الكود وتفهمه
  10. اذا الاكواد كلنت تقدر تستخدم onClientRender
  11. ابدا الاسم مو قريب خخخخخ مارتل Material
  12. اول مرة اشوف واحد يعرف للدي اكس مايعرف للجوي ههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه
  13. button = guiCreateButton ( 0.7, 0.1, 0.2, 0.1, "Test", true ) button1 = guiCreateButton ( 663, 315, 81, 51, "DONE !", false ) guiSetVisible ( button1, false ) addCommandHandler ( "Me", function ( ) guiSetVisible ( button1, true ) guiSetVisible ( button, false ) outputChatBox ( "DONE !", 0, 255, 0 ) end ) addCommandHandler ( "Me1", function ( ) guiSetVisible ( button1, false ) guiSetVisible ( button, true ) outputChatBox ( "DONE !", 0, 255, 0 ) end ) addEventHandler ( "onClientGUIClick", root, function ( ) return source == button and executeCommandHandler ( "Me" ) or source == button1 and executeCommandHandler ( "Me1" ) end ) showCursor ( true )
  14. لازم تتعلم لأن مايصير نعطيك وحنا اصلا ماندري عن الاكواد الي عندك
  15. القسم غلط + هذي تتغير على المشاركات
×
×
  • Create New...