Mr.Mostafa Posted September 9, 2018 Share Posted September 9, 2018 سلام عليكم معلش وين الخطا هنا .. ما يبي ينضاف الجدول بالقريد ليست Places = { ["الاماكن الرئسية"] = { ['القفزة الخنفشارية'] = {1550.0161132813, -1366.4044189453, 326.2109375} , ['مركز الشرطة'] = {1543.1385498047,-1677.0050048828,13.555870056152} , ['الطعس'] = {-2600,-2694.1176757813,10.188545227051} }, ["المهمات"] = { ["سرقة البنك"] = {593.50756835938,-1242.6812744141,18.018035888672}, }, ["الأماكن الحصرية"] = { ["مجمع المسابقات"] = {-2663.58301 ,-3501.63037 ,4.96875}, ["السينما"] = {-2273.44873 ,-3255.65088 ,4.96875} }, } function putPlaces() for i,v in ipairs(Places) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,v,false,false) end end Link to comment
KillerX Posted September 9, 2018 Share Posted September 9, 2018 يعني تبي كل الارقام والاحداثيات ذي في جدول لوحدها ولا معاها الكلام اللي جنبها مثل القفزة الخنفشارية والخ ؟؟ 1 Link to comment
#STARK Posted September 9, 2018 Share Posted September 9, 2018 (edited) 24 minutes ago, Mr.Mostafa said: سلام عليكم معلش وين الخطا هنا .. ما يبي ينضاف الجدول بالقريد ليست Places = { ["الاماكن الرئسية"] = { ['القفزة الخنفشارية'] = {1550.0161132813, -1366.4044189453, 326.2109375} , ['مركز الشرطة'] = {1543.1385498047,-1677.0050048828,13.555870056152} , ['الطعس'] = {-2600,-2694.1176757813,10.188545227051} }, ["المهمات"] = { ["سرقة البنك"] = {593.50756835938,-1242.6812744141,18.018035888672}, }, ["الأماكن الحصرية"] = { ["مجمع المسابقات"] = {-2663.58301 ,-3501.63037 ,4.96875}, ["السينما"] = {-2273.44873 ,-3255.65088 ,4.96875} }, } function putPlaces() for i,v in ipairs(Places) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,v,false,false) end end بدل ipairs بـ pairs في الرو indexو حط الـ عشان لو حطيت القيمه هتكون جدول اصلا function putPlaces() for i,v in pairs(Places) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,i,false,false) end end Edited September 9, 2018 by #STARK Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 11 hours ago, KillerX said: يعني تبي كل الارقام والاحداثيات ذي في جدول لوحدها ولا معاها الكلام اللي جنبها مثل القفزة الخنفشارية والخ ؟؟ لا ابي الجدول يكون فيه المهمات , + الاماكن الحصرية + الاماكن الرئيسيئة ولو ضغطت علي الاماكن الحصرية , يجيب الي فيها فهمتني ؟ 11 hours ago, #STARK said: عشان لو حطيت القيمه هتكون جدول اصلا طيب لو ابي اجيب القيمة الي بالترتيب 1 2 3 الخ كيف اجيبها ابي اظبطها لو ضغط علي الاماكن الحصرية يجيب جدول الاماكن الحصرية لو ضغط علي المهمات يجيب جدول المهمات والخ والخ بس بدون طريقة elseif Table = { ["الاماكن الرئسية"] = { ['القفزة الخنفشارية'] = {1550.0161132813, -1366.4044189453, 326.2109375} , ['مركز الشرطة'] = {1543.1385498047,-1677.0050048828,13.555870056152} , ['التل الشاهق'] = {-2393.25415, -2202.31543, 33.28906} , ['مقر الجيش'] = {146.66674804688, 1720, 17.640625} , ['السد الكبير'] = {-887.02734375, 2000.9217529297, 60.654315948486} , ['مننطقة البندقية'] = {723.33862, -1487.2187523047, 1.93434} , ['الجسر المعلق'] = {-2696.1865234375, 1232.7795410156, 55.621524810791} , ['الحفرة الكبيرة'] = {369.61615, 991.90735, 30.41144} , ['المطار الاول'] = {1717.6470947266, -2494.1176757813, 13.39999961853} , ['المطار الثاني'] = {1411.7646484375, 1482.3529052734, 10.89999961853} , ['المطار الثالث'] = {-1223.4300537109, -185.74758911133, 14.39999961853} , ['حارة سي جي'] = {2491.12109375, -1667.4482421875, 13.34375} , ['ساحه التفجير'] = {-2051.4926757813, -173.29304504395, 35.3203125}, ['الطعس'] = {-2600,-2694.1176757813,10.188545227051} }, ["المهمات"] = { ["سرقة البنك"] = {593.50756835938,-1242.6812744141,18.018035888672}, }, ["الأماكن الحصرية"] = { ["مجمع المسابقات"] = {-2663.58301 ,-3501.63037 ,4.96875}, ["السينما"] = {-2273.44873 ,-3255.65088 ,4.96875}, ["الــبــنــك"] = {-3211.35742 ,-3723.10620 ,4.96875}, ["المـخـيم"] = {-2656.83716 ,-4161.00293 ,4.96875}, ["المرقص"] = {216.82785 ,-1861.02026 ,3.04643}, ["المجمع السكني"] = {-2435.36230 ,-3533.46777 ,5.00000}, ["المسبح"] = {2900.79004, -635.14856, 10.83594}, }, } function putPlaces() for i,v in pairs(Table) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v,false,false) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,i,false,false) guiGridListSetItemData(GUIEditor.gridlist[1],row,2,i) guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,255,255) guiSetFont( GUIEditor.gridlist[1], "default-bold-small" ) end end addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.gridlist[1] then local Row , Col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local newText = guiGridListGetItemData ( GUIEditor.gridlist[1] , Row , Col ) if newText then guiGridListClear(GUIEditor.gridlist[1]) for i,v in pairs(Table) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,i[1],false,false) guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,255,255) guiSetFont( GUIEditor.gridlist[1], "default-bold-small" ) end end end end ) Link to comment
#STARK Posted September 10, 2018 Share Posted September 10, 2018 27 minutes ago, Mr.Mostafa said: لا ابي الجدول يكون فيه المهمات , + الاماكن الحصرية + الاماكن الرئيسيئة ولو ضغطت علي الاماكن الحصرية , يجيب الي فيها فهمتني ؟ طيب لو ابي اجيب القيمة الي بالترتيب 1 2 3 الخ كيف اجيبها ابي اظبطها لو ضغط علي الاماكن الحصرية يجيب جدول الاماكن الحصرية لو ضغط علي المهمات يجيب جدول المهمات والخ والخ بس بدون طريقة elseif Table = { ["الاماكن الرئسية"] = { ['القفزة الخنفشارية'] = {1550.0161132813, -1366.4044189453, 326.2109375} , ['مركز الشرطة'] = {1543.1385498047,-1677.0050048828,13.555870056152} , ['التل الشاهق'] = {-2393.25415, -2202.31543, 33.28906} , ['مقر الجيش'] = {146.66674804688, 1720, 17.640625} , ['السد الكبير'] = {-887.02734375, 2000.9217529297, 60.654315948486} , ['مننطقة البندقية'] = {723.33862, -1487.2187523047, 1.93434} , ['الجسر المعلق'] = {-2696.1865234375, 1232.7795410156, 55.621524810791} , ['الحفرة الكبيرة'] = {369.61615, 991.90735, 30.41144} , ['المطار الاول'] = {1717.6470947266, -2494.1176757813, 13.39999961853} , ['المطار الثاني'] = {1411.7646484375, 1482.3529052734, 10.89999961853} , ['المطار الثالث'] = {-1223.4300537109, -185.74758911133, 14.39999961853} , ['حارة سي جي'] = {2491.12109375, -1667.4482421875, 13.34375} , ['ساحه التفجير'] = {-2051.4926757813, -173.29304504395, 35.3203125}, ['الطعس'] = {-2600,-2694.1176757813,10.188545227051} }, ["المهمات"] = { ["سرقة البنك"] = {593.50756835938,-1242.6812744141,18.018035888672}, }, ["الأماكن الحصرية"] = { ["مجمع المسابقات"] = {-2663.58301 ,-3501.63037 ,4.96875}, ["السينما"] = {-2273.44873 ,-3255.65088 ,4.96875}, ["الــبــنــك"] = {-3211.35742 ,-3723.10620 ,4.96875}, ["المـخـيم"] = {-2656.83716 ,-4161.00293 ,4.96875}, ["المرقص"] = {216.82785 ,-1861.02026 ,3.04643}, ["المجمع السكني"] = {-2435.36230 ,-3533.46777 ,5.00000}, ["المسبح"] = {2900.79004, -635.14856, 10.83594}, }, } function putPlaces() for i,v in pairs(Table) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v,false,false) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,i,false,false) guiGridListSetItemData(GUIEditor.gridlist[1],row,2,i) guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,255,255) guiSetFont( GUIEditor.gridlist[1], "default-bold-small" ) end end addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.gridlist[1] then local Row , Col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local newText = guiGridListGetItemData ( GUIEditor.gridlist[1] , Row , Col ) if newText then guiGridListClear(GUIEditor.gridlist[1]) for i,v in pairs(Table) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,i[1],false,false) guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,255,255) guiSetFont( GUIEditor.gridlist[1], "default-bold-small" ) end end end end ) قصدك تعمل زي الفريروم ؟ Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 3 minutes ago, #STARK said: قصدك تعمل زي الفريروم ؟ لا لوحة انتقالات بس تكون اكثر من قسم Link to comment
#STARK Posted September 10, 2018 Share Posted September 10, 2018 Just now, Mr.Mostafa said: لا لوحة انتقالات بس تكون اكثر من قسم انت خارب كود اللوب تماما يراجل في الجريدليست ( index ) شوف , اعمل لوب للجدول بعدين حط مفتاح الجدول ( value ) و حط علي الروو داتا بالقيمه و اعمل لما اللاعب يدوس علي الجريدليست يجيب الداتا الي علي الروو و يمسح الجريد ليست و يعمل لوب و يحط الأحداثيات ( ... )و حط زي الفري روم كدا عئشان لما يدوس عليهم يرجع للقائمه Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 1 minute ago, #STARK said: انت خارب كود اللوب تماما يراجل في الجريدليست ( index ) شوف , اعمل لوب للجدول بعدين حط مفتاح الجدول ( value ) و حط علي الروو داتا بالقيمه و اعمل لما اللاعب يدوس علي الجريدليست يجيب الداتا الي علي الروو و يمسح الجريد ليست و يعمل لوب و يحط الأحداثيات ( ... )و حط زي الفري روم كدا عئشان لما يدوس عليهم يرجع للقائمه ادري حاولت اسويها , لكن ما عرفت Table = { ["الاماكن الرئسية"] = { ['القفزة الخنفشارية'] = {1550.0161132813, -1366.4044189453, 326.2109375} , ['مركز الشرطة'] = {1543.1385498047,-1677.0050048828,13.555870056152} , ['التل الشاهق'] = {-2393.25415, -2202.31543, 33.28906} , ['مقر الجيش'] = {146.66674804688, 1720, 17.640625} , ['السد الكبير'] = {-887.02734375, 2000.9217529297, 60.654315948486} , ['مننطقة البندقية'] = {723.33862, -1487.2187523047, 1.93434} , ['الجسر المعلق'] = {-2696.1865234375, 1232.7795410156, 55.621524810791} , ['الحفرة الكبيرة'] = {369.61615, 991.90735, 30.41144} , ['المطار الاول'] = {1717.6470947266, -2494.1176757813, 13.39999961853} , ['المطار الثاني'] = {1411.7646484375, 1482.3529052734, 10.89999961853} , ['المطار الثالث'] = {-1223.4300537109, -185.74758911133, 14.39999961853} , ['حارة سي جي'] = {2491.12109375, -1667.4482421875, 13.34375} , ['ساحه التفجير'] = {-2051.4926757813, -173.29304504395, 35.3203125}, ['الطعس'] = {-2600,-2694.1176757813,10.188545227051} }, ["المهمات"] = { ["سرقة البنك"] = {593.50756835938,-1242.6812744141,18.018035888672}, }, ["الأماكن الحصرية"] = { ["مجمع المسابقات"] = {-2663.58301 ,-3501.63037 ,4.96875}, ["السينما"] = {-2273.44873 ,-3255.65088 ,4.96875}, ["الــبــنــك"] = {-3211.35742 ,-3723.10620 ,4.96875}, ["المـخـيم"] = {-2656.83716 ,-4161.00293 ,4.96875}, ["المرقص"] = {216.82785 ,-1861.02026 ,3.04643}, ["المجمع السكني"] = {-2435.36230 ,-3533.46777 ,5.00000}, ["المسبح"] = {2900.79004, -635.14856, 10.83594}, }, } function putPlaces() for i,v in pairs(Table) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v,false,false) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,i,false,false) guiGridListSetItemData(GUIEditor.gridlist[1],row,2,i) guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,255,255) guiSetFont( GUIEditor.gridlist[1], "default-bold-small" ) end end addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.gridlist[1] then local Row , Col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local newText = guiGridListGetItemData ( GUIEditor.gridlist[1] , Row , Col ) if newText then guiGridListClear(GUIEditor.gridlist[1]) for i,v in pairs(Table) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1],row,2,i[1],false,false) guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,255,255) guiSetFont( GUIEditor.gridlist[1], "default-bold-small" ) end end end end ) Link to comment
#STARK Posted September 10, 2018 Share Posted September 10, 2018 Table = { ["الاماكن الرئسية"] = { ['القفزة الخنفشارية'] = {1550.0161132813, -1366.4044189453, 326.2109375} , ['مركز الشرطة'] = {1543.1385498047,-1677.0050048828,13.555870056152} , ['التل الشاهق'] = {-2393.25415, -2202.31543, 33.28906} , ['مقر الجيش'] = {146.66674804688, 1720, 17.640625} , ['السد الكبير'] = {-887.02734375, 2000.9217529297, 60.654315948486} , ['مننطقة البندقية'] = {723.33862, -1487.2187523047, 1.93434} , ['الجسر المعلق'] = {-2696.1865234375, 1232.7795410156, 55.621524810791} , ['الحفرة الكبيرة'] = {369.61615, 991.90735, 30.41144} , ['المطار الاول'] = {1717.6470947266, -2494.1176757813, 13.39999961853} , ['المطار الثاني'] = {1411.7646484375, 1482.3529052734, 10.89999961853} , ['المطار الثالث'] = {-1223.4300537109, -185.74758911133, 14.39999961853} , ['حارة سي جي'] = {2491.12109375, -1667.4482421875, 13.34375} , ['ساحه التفجير'] = {-2051.4926757813, -173.29304504395, 35.3203125}, ['الطعس'] = {-2600,-2694.1176757813,10.188545227051} }, ["المهمات"] = { ["سرقة البنك"] = {593.50756835938,-1242.6812744141,18.018035888672}, }, ["الأماكن الحصرية"] = { ["مجمع المسابقات"] = {-2663.58301 ,-3501.63037 ,4.96875}, ["السينما"] = {-2273.44873 ,-3255.65088 ,4.96875}, ["الــبــنــك"] = {-3211.35742 ,-3723.10620 ,4.96875}, ["المـخـيم"] = {-2656.83716 ,-4161.00293 ,4.96875}, ["المرقص"] = {216.82785 ,-1861.02026 ,3.04643}, ["المجمع السكني"] = {-2435.36230 ,-3533.46777 ,5.00000}, ["المسبح"] = {2900.79004, -635.14856, 10.83594}, }, } function putPlaces() guiGridListClear(GUIEditor.gridlist[1]) for i,v in pairs(Table) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], row, 1, i, false, false) guiGridListSetItemData(GUIEditor.gridlist[1], row, 1, v) end end guiSetFont(GUIEditor.gridlist[1], "default-bold-small") addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 1) if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 1, "...", false, false) for i,v in pairs(tab) do local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, i, false, false) end else if guiGridListGetItemText(source, Row, 1) == "..." then putPlaces() end end end end ) Link to comment
KillerX Posted September 10, 2018 Share Posted September 10, 2018 (edited) تقدر تحط الاحداثيات في جدول والكتابة في جدول اخر والصفوف الاساسية مثل القسم الرئيسي و والمهمات وكدا سويهم كوليمن في الجريد ليست نفسوا مثل كدا Table1 = {'القفزة الخنفشارية' , 'مركز الشرطة' , 'الطعس' , 'سرقة البنك' , 'مجمع المسابقات' , 'السينما'} Table2 = {'1550.0161132813, -1366.4044189453, 326.2109375' , '1543.1385498047,-1677.0050048828,13.555870056152' , '-2600,-2694.1176757813,10.188545227051' , '593.50756835938,-1242.6812744141,18.018035888672' , '-2663.58301 ,-3501.63037 ,4.96875' , '-2273.44873 ,-3255.65088 ,4.96875' } Row2 = -1 Row3 = -1 GUIEditor = { gridlist = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.gridlist[1] = guiCreateGridList(244, 188, 599, 441, false) One = guiGridListAddColumn(GUIEditor.gridlist[1], "الاماكن الرئسية", 0.3) Two = guiGridListAddColumn(GUIEditor.gridlist[1], "المهمات", 0.3) Three = guiGridListAddColumn(GUIEditor.gridlist[1], "الاماكن الحصرية", 0.3) end ) bindKey( 'f2' , 'down' , function( ) guiGridListClear( GUIEditor.gridlist[1] ) for n = 1 , 6 , 1 do if ( n <= 3 ) then Row = guiGridListAddRow( GUIEditor.gridlist[1] ) guiGridListSetItemText( GUIEditor.gridlist[1] , Row , One , Table2[n] .. ' : ' .. Table1[n] , false , false) elseif ( n <= 4 ) then Row2 = Row2 + 1 guiGridListSetItemText( GUIEditor.gridlist[1] , Row2 , Two , Table2[n] .. ' : ' .. Table1[n] , false , false) elseif ( n <= 5 ) then Row3 = Row3 + 1 guiGridListSetItemText( GUIEditor.gridlist[1] , Row3 , Three , Table2[n] .. ' : ' .. Table1[n] , false , false) end end end ) يمكن معقد شوي بس لو مش فاهم شئ قولي Edited September 10, 2018 by KillerX Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 (edited) 12 minutes ago, #STARK said: يب تمام تسلم بس لو ابي اضيف ترتيب مثلا , حاولت اسويها اني احط القيمة لكن ما ظبطت + ليه كدا ما ظبطت ابي لو ضغطت مرتين , ينتقل للاحداثيات الي موجودة بالتابل addEventHandler("onClientGUIDoubleClick",root, function () local s = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if source == GUIEditor.gridlist[1] then local x,y,z = unpack(guiGridListGetItemData(GUIEditor.gridlist[1],s,2)) setElementPosition(localPlayer,x,y,z) end end ) addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 2) if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, i) end else if guiGridListGetItemText(source, Row, 2) == "..." then putPlaces() end end end end ) Edited September 10, 2018 by Mr.Mostafa Link to comment
#STARK Posted September 10, 2018 Share Posted September 10, 2018 40 minutes ago, Mr.Mostafa said: + ليه كدا ما ظبطت مش قيمه رقميه, ذي قيمه نصيه index بكل بساطه عشان لو تبي تبي تحط الأرقام استعمال المتغيرات local var = 0 var = var + 1 بالنسبه بقا لنقل الاحداثيات الي بالكود الي فوق بدي onClientGUIClick بدل addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 1) if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 1, "...", false, false) for i,v in pairs(tab) do local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, i, false, false) guiGridListSetItemData(source, row, 1, v, false, false) end else if guiGridListGetItemText(source, Row, 1) == "..." then putPlaces() end end end end ) Link to comment
#Mr.ZaMoRa Posted September 10, 2018 Share Posted September 10, 2018 تقصد هيك بس للانتقالات ؟ Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 30 minutes ago, #STARK said: الي بالكود الي فوق بدي onClientGUIClick بدل سويت v, لكن حتي ما ظبطت مدري ليه + بالنسبة للارقام , جربت المتغيرات لكن تيجي كدا كل القريد ليست يكون رقم 2 local id = 1 addEventHandler("onClientGUIClick",root, function() id = id+1 if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 2) if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, id, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, v) end else if guiGridListGetItemText(source, Row, 2) == "..." then putPlaces() end end end end ) Link to comment
#STARK Posted September 10, 2018 Share Posted September 10, 2018 (edited) 1 hour ago, Mr.Mostafa said: سويت v, لكن حتي ما ظبطت مدري ليه + بالنسبة للارقام , جربت المتغيرات لكن تيجي كدا كل القريد ليست يكون رقم 2 local id = 1addEventHandler("onClientGUIClick",root, function() id = id+1 if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 2) if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, id, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, v) end else if guiGridListGetItemText(source, Row, 2) == "..." then putPlaces() end end end end ) انت خربت الكود خالص الي عملته انك تزود المتغير كل مره تدوس علي اي عنصر ( GUI - Element ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.gridlist[1] then local Row, tab, var = guiGridListGetSelectedItem(source), guiGridListGetItemData(source, Row, 2), 0 if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do var = var + 1 local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, var, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, v) end else if guiGridListGetItemText(source, Row, 2) == "..." then putPlaces() end end end end ) Edited September 10, 2018 by #STARK Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 3 minutes ago, #STARK said: اها تمام Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 2 hours ago, #STARK said: الي بالكود الي فوق بدي onClientGUIClick بدل ما ظبطت لما اجي انتقل لمكان , ينتقل لكن القريد ليست تختفي الاماكن ويجي كذا addEventHandler("onClientGUIDoubleClick",root, function () local s = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if source == GUIEditor.gridlist[1] then local x,y,z = unpack(guiGridListGetItemData(GUIEditor.gridlist[1],s,2)) setElementPosition(localPlayer,x,y,z) end end ) addEventHandler("onClientGUIDoubleClick",root, function() if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 2) local var = 0 if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do var = var + 1 local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, var, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, v, false, false) end else if guiGridListGetItemText(source, Row, 2) == "..." then putPlaces() end end end end ) Link to comment
#STARK Posted September 10, 2018 Share Posted September 10, 2018 16 minutes ago, Mr.Mostafa said: ما ظبطت لما اجي انتقل لمكان , ينتقل لكن القريد ليست تختفي الاماكن ويجي كذا addEventHandler("onClientGUIDoubleClick",root, function () local s = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if source == GUIEditor.gridlist[1] then local x,y,z = unpack(guiGridListGetItemData(GUIEditor.gridlist[1],s,2)) setElementPosition(localPlayer,x,y,z) end end ) addEventHandler("onClientGUIDoubleClick",root, function() if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 2) local var = 0 if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do var = var + 1 local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, var, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, v, false, false) end else if guiGridListGetItemText(source, Row, 2) == "..." then putPlaces() end end end end ) function putPlaces() local var = 0 guiGridListClear(GUIEditor.gridlist[1]) for i,v in pairs(Table) do var = var + 1 local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], row, 1, var, false, false) guiGridListSetItemText(GUIEditor.gridlist[1], row, 2, i, false, false) guiGridListSetItemData(GUIEditor.gridlist[1], row, 2, v) end end addEventHandler("onClientGUIDoubleClick", guiRoot, function() if source == GUIEditor.gridlist[1] then local row = guiGridListGetSelectedItem(source) if row and row ~= -1 then if guiGridListGetItemData(source, row, 2) then local x, y, z = unpack(guiGridListGetItemData(source, row, 2)) if x and y and z then setElementPosition(localPlayer, x, y, z) end else if guiGridListGetItemText(source, row, 2) == "..." then putPlaces() end end end end end ) addEventHandler("onClientGUIDoubleClick",root, function() if source == GUIEditor.gridlist[1] then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 2) local var = 1 if tab and type(tab) == "table" then guiGridListClear(source) guiGridListSetItemText(source, guiGridListAddRow(source), 1, "1", false, false) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do var = var + 1 local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, var, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, v, false, false) end end end end ) Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 8 minutes ago, #STARK said: نفس المشكلة Link to comment
Trefeor Posted September 10, 2018 Share Posted September 10, 2018 جرب هذا Table = { ["الاماكن الرئسية"] = { ['القفزة الخنفشارية'] = {1550.0161132813, -1366.4044189453, 326.2109375} , ['مركز الشرطة'] = {1543.1385498047,-1677.0050048828,13.555870056152} , ['التل الشاهق'] = {-2393.25415, -2202.31543, 33.28906} , ['مقر الجيش'] = {146.66674804688, 1720, 17.640625} , ['السد الكبير'] = {-887.02734375, 2000.9217529297, 60.654315948486} , ['مننطقة البندقية'] = {723.33862, -1487.2187523047, 1.93434} , ['الجسر المعلق'] = {-2696.1865234375, 1232.7795410156, 55.621524810791} , ['الحفرة الكبيرة'] = {369.61615, 991.90735, 30.41144} , ['المطار الاول'] = {1717.6470947266, -2494.1176757813, 13.39999961853} , ['المطار الثاني'] = {1411.7646484375, 1482.3529052734, 10.89999961853} , ['المطار الثالث'] = {-1223.4300537109, -185.74758911133, 14.39999961853} , ['حارة سي جي'] = {2491.12109375, -1667.4482421875, 13.34375} , ['ساحه التفجير'] = {-2051.4926757813, -173.29304504395, 35.3203125}, ['الطعس'] = {-2600,-2694.1176757813,10.188545227051} }, ["المهمات"] = { ["سرقة البنك"] = {593.50756835938,-1242.6812744141,18.018035888672}, }, ["الأماكن الحصرية"] = { ["مجمع المسابقات"] = {-2663.58301 ,-3501.63037 ,4.96875}, ["السينما"] = {-2273.44873 ,-3255.65088 ,4.96875}, ["الــبــنــك"] = {-3211.35742 ,-3723.10620 ,4.96875}, ["المـخـيم"] = {-2656.83716 ,-4161.00293 ,4.96875}, ["المرقص"] = {216.82785 ,-1861.02026 ,3.04643}, ["المجمع السكني"] = {-2435.36230 ,-3533.46777 ,5.00000}, ["المسبح"] = {2900.79004, -635.14856, 10.83594}, }, } selc = "" function putPlaces() selc = "" local var = 0 guiGridListClear(GUIEditor.gridlist[1]) for i,v in pairs(Table) do var = var + 1 local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], row, 1, var, false, false) guiGridListSetItemText(GUIEditor.gridlist[1], row, 2, i, false, false) guiGridListSetItemData(GUIEditor.gridlist[1], row, 2, v) end end addEventHandler("onClientGUIDoubleClick", guiRoot, function() if source == GUIEditor.gridlist[1] then local row = guiGridListGetSelectedItem(source) if row and row ~= -1 then if guiGridListGetItemData(source, row, 2) then local x, y, z = unpack(guiGridListGetItemData(source, row, 2)) if x and y and z then setElementPosition(localPlayer, x, y, z) end else if guiGridListGetItemText(source, row, 2) == "..." then putPlaces() selc = "" end end end end end ) addEventHandler("onClientGUIDoubleClick",root, function() if source == GUIEditor.gridlist[1] then if ( selc == "" ) then local Row = guiGridListGetSelectedItem(source) local tab = guiGridListGetItemData(source, Row, 2) local var = 1 if tab and type(tab) == "table" then selc = guiGridListGetItemText ( source , Row , 2 ) guiGridListClear(source) -- guiGridListSetItemText(source, guiGridListAddRow(source), 1, "1", false, false) guiGridListSetItemText(source, guiGridListAddRow(source), 2, "...", false, false) for i,v in pairs(tab) do var = var + 1 local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, var, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemData(source, row, 2, v, false, false) end end end end end ) Link to comment
#STARK Posted September 10, 2018 Share Posted September 10, 2018 2 hours ago, Mr.Mostafa said: نفس المشكلة مش شايف مشاكل في كودي او اخطاء .. Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 1 hour ago, Trefeor said: جرب هذا Client:71 : '=' expected near ' 71 : selc = "" خلاص تمام ظبطت معي تسلموا :) Link to comment
Mr.Mostafa Posted September 10, 2018 Author Share Posted September 10, 2018 معلش تعبتكم معي , بس جاتني مشكلة تانية آبي آجيب آلمسآفة آلي بينه وبين آلمكآن , وحآولت بدون سبليت وبسبليت ومآ ظبطت for i,v in pairs(tab) do local x1,y1,z1 = getElementPosition(localPlayer) local x2,y2,z2 = split(v, ',') local dis = getDistanceBetweenPoints3D ( x1,y1,z1,x2,y2,z2 ) var = var + 1 local row = guiGridListAddRow(source) guiGridListSetItemText(source, row, 1, var, false, false) guiGridListSetItemText(source, row, 2, i, false, false) guiGridListSetItemText(source, row, 3, dis, false, false) guiGridListSetItemData(source, row, 2, v, false, false) end Link to comment
Guest Posted September 10, 2018 Share Posted September 10, 2018 5 hours ago, #Mr.ZaMoRa said: تقصد هيك بس للانتقالات ؟ Server Taim ? ههههههههههههههههههههههههههههههههههههههه يرجال الانجليزية ذاهبة عليك .. 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