Jump to content

جريد ليست


Recommended Posts

Posted (edited)

local = متغير

مثال

addCommandHandler("myname", 
  function() 
   local localPlayerName = getPlayerName(localPlayer) 
   outputChatBox(localPlayerName) 
  end 
) 
  

List = { -- سوينا جدول 
{"البداية -1",832.931640625, -4505.3212890625, 13.8719911575317}, 
{"آلدآئري -2",1797.1727294922, 842.46630859375, 10.6328125}, 
{"آلنخيل -3",2068.7211914063, 907.06707763672, 8.1701345443726}, 
{"آلطعوس -4",-2617.193359375, -2547.3530273438, 3}, 
{"آلغروب -5",662.55310058594, 1936.7479248047, 5.5052728652954}, 
{"الشارع الطويل -6",-2876.2788085938, -3004.4331054688, 12.39999961853}, 
{"البنك -7",596.37750244141, -1241.4223632813, 18.39999961853}, 
{"المطار الاول -8",1717.6470947266, -2494.1176757813, 13.39999961853}, 
{"المطار الثاني -9",-1223.4300537109, -185.74758911133, 14.39999961853}, 
{"المطار الثالث -10",1411.7646484375, 1482.3529052734, 10.89999961853}, 
} 
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(438, 249, 284, 337, "التنقل", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(9, 30, 265, 234, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "أسم المكان", 0.9) 
        for k,v in ipairs(List) do -- نجيب الي حطيناه بالجدول 
        local row = guiGridListAddRow(GUIEditor.gridlist[1]) -- نسوي رو بالجدول 
        guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v[1],false,false) -- نحط اسماء الأماكن مثلا الغروب ونحطهم في رو 
        guiGridListSetItemData(GUIEditor.gridlist[1],row,1,{v[2],v[3],v[4]}) -- نحط داتا  
        end      
        GUIEditor.button[1] = guiCreateButton(9, 300, 82, 27, "نقل", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(192, 301, 82, 26, "أغلاق", false, GUIEditor.window[1])     
    end 
) 
  
addEventHandler ( "onClientGUIClick", resourceRoot, function (    ) 
    if ( source == GUIEditor.button[1] ) then 
        if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 ) then  
            setElementPosition ( localPlayer, unpack ( guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) ) ) 
                outputChatBox ( "* تم الإنتقال بنجاح", 0, 255, 0, true ) 
            else 
                outputChatBox ( "* الرجاء اختيار مكان للإنتقال إليه", 255, 0, 0, true ) 
        end 
    end 
end ) 
  
bindKey ("F2", "down", function () 
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end) 

هذي على اكواد لوحتك تفتح من اف 2

Edited by Guest
Quote

"I ain't saying I'm the best, but I should be in the top ten; give me a list of names, I'ma top them,
I'm just playing with ya. I don't care where the top is,
Leave me at the bottom, let me work for it.
"

 

_________________________________________________________________________________________________________________

ACM

90183-bed46f22aafe8af7dc65cdd73fff2f76-medium_jpg.jpg?buster=1481325396W_#9661

  • Replies 139
  • Created
  • Last Reply

Top Posters In This Topic

Posted
for k,v in ipairs(List) do -- نجيب الي حطيناه بالجدول

ما فهمت شي من هنا

الحين انا مو سويت جدول ؟

كيف راح يجيب الي بالجدول ؟

يعني الجن راح يجيب الاماكن الي بالجدول ض2

باختصار

هذا يجيب الشي الي حاطه بالجدول

في حالتنا هو بيجيب الاماكن الي حطيناها بالجدول

اتعشى واجيك ..

Quote

"I ain't saying I'm the best, but I should be in the top ten; give me a list of names, I'ma top them,
I'm just playing with ya. I don't care where the top is,
Leave me at the bottom, let me work for it.
"

 

_________________________________________________________________________________________________________________

ACM

90183-bed46f22aafe8af7dc65cdd73fff2f76-medium_jpg.jpg?buster=1481325396W_#9661

Posted

for k,v in ipairs(List) do

يعني ذا الكود يلي فوق دايما احطه لما احط جدول؟؟

وبين القوسين اسم المتغير؟؟

 

 

 

 

Posted
for k,v in ipairs(List) do

يعني ذا الكود يلي فوق دايما احطه لما احط جدول؟؟

وبين القوسين اسم المتغير؟؟

https://forum.multitheftauto.com/viewtopic.php?f=160&t=97915

شوف الاشياء يلي به من بيست وتابل

مستواي في البرمجة 20%

Skype = mr_m.o.s.t.a.f.a

youtube = https://www.youtube.com/channel/UCEwOQx793Uxq5wazYDi-6mQ

Posted
for k,v in ipairs(List) do

يعني ذا الكود يلي فوق دايما احطه لما احط جدول؟؟

وبين القوسين اسم المتغير؟؟

يب بين القوسين اسم متغير الجدول

بتحتاجه عشان تجلب الي بالجدول

Quote

"I ain't saying I'm the best, but I should be in the top ten; give me a list of names, I'ma top them,
I'm just playing with ya. I don't care where the top is,
Leave me at the bottom, let me work for it.
"

 

_________________________________________________________________________________________________________________

ACM

90183-bed46f22aafe8af7dc65cdd73fff2f76-medium_jpg.jpg?buster=1481325396W_#9661

Posted
MD = { 
{"1-الجبل",-2242.18115,-1726.20325,480.39978} 
{"2-الصحراء",214.83893,1863.85681,13.14063} 
{"3-حارة سي جي",2384.80933,-1669.25671,13.73438} 
} 
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(72, 231, 231, 265, "الأنتقالات", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(10, 43, 211, 134, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "الأماكن", 0.9) 
        for k,v in ipairs(MD) do 
           s = guiGridListAddRow(GUIEditor.gridlist[1]) 
           guiGridListSetItemText(GUIEditor.gridlist[1],s,1,v[1],false,false) 
           guiGridListSetItemData(GUIEditor.gridlist[1],s,1,{v[2],v[3],v[4]}) 
        end 
         
        GUIEditor.button[1] = guiCreateButton(9, 222, 212, 33, "أغلاق", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(10, 179, 211, 33, "نقل", false, GUIEditor.window[1])     
    end 
) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if (source == GUIEditor.button[2]) then 
if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 ) then 
            setElementPosition ( localPlayer, unpack ( guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) ) ) 
                outputChatBox ( "* تم الإنتقال بنجاح", 0, 255, 0, true ) 
            else 
                outputChatBox ( "* الرجاء اختيار مكان للإنتقال إليه", 255, 0, 0, true ) 
        end 
    end 
end ) 
  
bindKey ("F2", "down", function () 
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end) 

في اشياء ما نسختها واشياء ما فهمتها ونسختها المهم يقولي خطأ بسطر 3

 

 

 

 

Posted
MD = { 
{"1-الجبل",-2242.18115,-1726.20325,480.39978} 
{"2-الصحراء",214.83893,1863.85681,13.14063} 
{"3-حارة سي جي",2384.80933,-1669.25671,13.73438} 
} 
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(72, 231, 231, 265, "الأنتقالات", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(10, 43, 211, 134, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "الأماكن", 0.9) 
        for k,v in ipairs(MD) do 
           s = guiGridListAddRow(GUIEditor.gridlist[1]) 
           guiGridListSetItemText(GUIEditor.gridlist[1],s,1,v[1],false,false) 
           guiGridListSetItemData(GUIEditor.gridlist[1],s,1,{v[2],v[3],v[4]}) 
        end 
         
        GUIEditor.button[1] = guiCreateButton(9, 222, 212, 33, "أغلاق", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(10, 179, 211, 33, "نقل", false, GUIEditor.window[1])     
    end 
) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if (source == GUIEditor.button[2]) then 
if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 ) then 
            setElementPosition ( localPlayer, unpack ( guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) ) ) 
                outputChatBox ( "* تم الإنتقال بنجاح", 0, 255, 0, true ) 
            else 
                outputChatBox ( "* الرجاء اختيار مكان للإنتقال إليه", 255, 0, 0, true ) 
        end 
    end 
end ) 
  
bindKey ("F2", "down", function () 
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end) 

في اشياء ما نسختها واشياء ما فهمتها ونسختها المهم يقولي خطأ بسطر 3

جرب كذا

MD = { 
{"1-الجبل",-2242.18115,-1726.20325,480.39978}, 
{"2-الصحراء",214.83893,1863.85681,13.14063}, 
{"3-حارة سي جي",2384.80933,-1669.25671,13.73438}, 
} 

* There is no God but Allah, Mohammed is the Messenger Of Allah

Posted

مشكور Mr.R

strong

بس في شغلات حاولت افهمها ما رضت تتدخل بدماغي مثلن

if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 )

ليه حطيت لا يساوي -1؟؟

guiGridListClear 
getElementsByType -- loop ( player ) 
  
guiGridListAddRow 
guiGridListSetItemText 
  
  
- 
  
guiGridListGetItemText 
guiGridListGetSelectedItem 
  

بالنسبة لردك الاول ممكن تحط كل واحد وش وظيفته جمبه ويكون واضح شوية

 

 

 

 

Posted
مشكور Mr.R

strong

بس في شغلات حاولت افهمها ما رضت تتدخل بدماغي مثلن

if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 )

ليه حطيت لا يساوي -1؟؟

guiGridListClear 
getElementsByType -- loop ( player ) 
  
guiGridListAddRow 
guiGridListSetItemText 
  
  
- 
  
guiGridListGetItemText 
guiGridListGetSelectedItem 
  

بالنسبة لردك الاول ممكن تحط كل واحد وش وظيفته جمبه ويكون واضح شوية

اعتقد معناه اذا كان شي واحد محدد

بالنسبة للفنكشنات

guiGridListClear -- هذا عشان ما يكرر الاسماء مرتين بالقريد ليست 
getElementsByType -- loop ( player ) -- يسوي لوب لكل اللاعبين يعني يجيب كل اللاعبين 
  
guiGridListAddRow -- يسويلهم أضافة رو 
guiGridListSetItemText -- يحط الكلام , مثلا يحط اسم اللاعبين نستخدمه مع الفنكشن الي تحت 
getPlayerName -- يجيب اسماء اللاعبين 
  
  
- 
  
guiGridListGetItemText -- يجيب الكلام الي بالقريد ليست 
guiGridListGetSelectedItem -- يجب الشي الي حددناه 
Quote

"I ain't saying I'm the best, but I should be in the top ten; give me a list of names, I'ma top them,
I'm just playing with ya. I don't care where the top is,
Leave me at the bottom, let me work for it.
"

 

_________________________________________________________________________________________________________________

ACM

90183-bed46f22aafe8af7dc65cdd73fff2f76-medium_jpg.jpg?buster=1481325396W_#9661

Posted
Deleted*

--------------------------------------

ششكراً ..

بس اخاف اني ما استفيد حاجةة

المهم بكمل الباقي ..

وهو الزر اذا سويته ,,

ويلا الحين ابرمج ,,

ابي استفسر

  
local wifii = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) 
if wifii~= -1 then 
  

Returns the row and column indexes of the selected item if the specified grid list is valid and has a selected item, (-1, -1) if no item is selected, false otherwise.

(row) دة تحقق ان الجريد ليست فيها حاجة متحددة بالماوس

يرجعلك القيمة 1 لو انت محدد حاجة

و يرجعلك القيمة -1 لو انت مش محدد حاجة

145882553665171.png

local wifii = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) 
> wifii == 1 --  

145882587007741.png

local wifii = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) 
> wifii == -1 --  

يوضحكك

Experienced MTA developer for 4 years. | MTA خبرة 4 سنين في برمجة

ليس عليك اسعاد الجميع ,
ولكن عليك بإن لا تؤذي أحداً 

=========
You do not have to make everyone happy,
But you should not hurt anyone

 

Want to contact with me?

 

Discord: JustCarry#2616 (Always there)
Skype: Live:JustCarry10 (Not always)

Posted

بأختصار معناه اذا ما كان محدد شي من القريد ليست

Quote

"I ain't saying I'm the best, but I should be in the top ten; give me a list of names, I'ma top them,
I'm just playing with ya. I don't care where the top is,
Leave me at the bottom, let me work for it.
"

 

_________________________________________________________________________________________________________________

ACM

90183-bed46f22aafe8af7dc65cdd73fff2f76-medium_jpg.jpg?buster=1481325396W_#9661

Posted

الجريد ليست بدها واحد صاحي مب نايم هههههه بروح انام بكرة بشوف كيف الوضع

تصبحون على خير

 

 

 

 

Posted
الجريد ليست بدها واحد صاحي مب نايم هههههه بروح انام بكرة بشوف كيف الوضع

تصبحون على خير

:lol: وانت من اهل الخير ..

Quote

"I ain't saying I'm the best, but I should be in the top ten; give me a list of names, I'ma top them,
I'm just playing with ya. I don't care where the top is,
Leave me at the bottom, let me work for it.
"

 

_________________________________________________________________________________________________________________

ACM

90183-bed46f22aafe8af7dc65cdd73fff2f76-medium_jpg.jpg?buster=1481325396W_#9661

Posted

سؤال بس انا سويت ميمو لكن لما اركبها واشغل المود الاعب يقدر يكتب بالميمو ابيه ما ينفع يكتب شي بالميمو كيف؟؟

 

 

 

 

Posted

يب حطه تحت الميمو

ملاحظه تقدر تسويه من الجيو اديتور وانت بتصمم اللوحه

read only لما تختار الميمو وتحطه داخل اللوحه بتلاقي كلمه اسمها

حط عليها علامة الصح وبكذا تخلي اللاعب مايقدر يكتب

لا اله الا انت سبحانك اني كنت من الظالمين

TehLMGN.png?1

My Group : https://www.facebook.com/groups/992678147519191/

Posted
في فنكشن يحذف الماركراو يعطله مؤقت
destroyElement 

:|

Discord: LoOs#1111

_____________________________

76561198299431254.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...