Jump to content

طلب فنكشنات


Recommended Posts

السلام عليكم ورحمة الله تعالى وببركاته

كيف حالكم شباب ؟

طلباتي كثرت هاليومين

المهم

ابي فنكشنات علشان لما اضغط على الجريد لست يعرضلي صورة

يعني مثل مود دمعرض السيارات لما اضغط على اسم السيارة يطلعلي صورتها

اتمنى تردو باسرع وقت

Link to comment

إستبدل الـ ,

gridlist

بإسم القريد لست حقك.

واستبدل احداثيات الصورة بإحداثيات صورتك : )

ImgTable = {  
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 200, 200, 100, 100, "img1.png", false ); 
guiSetVisible ( img, false ); 
  
for i, v in ipairs ( ImgTable ) do 
    local row = guiGridListAddRow ( gridlist ); 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
end 
     
addEventHandler ( "onClientGUIClick", root, 
    function (  ) 
        if source == gridlist then 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
            if filePath and filePath ~= "" then 
                guiStaticImageLoadImage ( img, filePath ); 
            end 
        end 
    end 
); 

Link to comment
إستبدل الـ ,

gridlist

بإسم القريد لست حقك.

واستبدل احداثيات الصورة بإحداثيات صورتك : )

ImgTable = {  
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 200, 200, 100, 100, "img1.png", false ); 
guiSetVisible ( img, false ); 
  
for i, v in ipairs ( ImgTable ) do 
    local row = guiGridListAddRow ( gridlist ); 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
end 
     
addEventHandler ( "onClientGUIClick", root, 
    function (  ) 
        if source == gridlist then 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
            if filePath and filePath ~= "" then 
                guiStaticImageLoadImage ( img, filePath ); 
            end 
        end 
    end 
); 

اخ جعفر اشرح كودك سطر سطر محتاجه

ووين احط صور ووش تقصد باحداثيات صوره اشرح كود كامل لاهنت

Link to comment
إستبدل الـ ,

gridlist

بإسم القريد لست حقك.

واستبدل احداثيات الصورة بإحداثيات صورتك : )

ImgTable = {  
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 200, 200, 100, 100, "img1.png", false ); 
guiSetVisible ( img, false ); 
  
for i, v in ipairs ( ImgTable ) do 
    local row = guiGridListAddRow ( gridlist ); 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
end 
     
addEventHandler ( "onClientGUIClick", root, 
    function (  ) 
        if source == gridlist then 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
            if filePath and filePath ~= "" then 
                guiStaticImageLoadImage ( img, filePath ); 
            end 
        end 
    end 
); 

اخ جعفر اشرح كودك سطر سطر محتاجه

ووين احط صور ووش تقصد باحداثيات صوره اشرح كود كامل لاهنت

أنا عامل إحداثيات الصورة من عندي إلى هي

200, 200, 100, 100

لكن طبعاً الإحداثيات الموجودة عنده غير عني

--

بالنسبة لشرح الكود:

ImgTable = {  -- جدول عشان تضيف أسماء الصور + إسمها الموجود في المود 
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 200, 200, 100, 100, "img1.png", false ); -- إنشاء صورة 
guiSetVisible ( img, false ); -- نخفي الصورة 
  
for i, v in ipairs ( ImgTable ) do -- نجيب جميع القيم الموجودة ف الجدول 
    local row = guiGridListAddRow ( gridlist ); -- نضيف سطر 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); -- نخلي أسماء الصور داخل القريد ليست 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); -- نحط داتا على إسم الصورة عشان نجيب مسارها  
end -- إغلاق اللوب 
     
addEventHandler ( "onClientGUIClick", root, -- حدث ضغط الزر 
    function (  ) -- وظيفة 
        if source == gridlist then -- إذا ضغطت على القريد ليست 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end -- إذا كانت الصورة مخفية نجعلها تظهر 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); -- نجيب مسار الصورة المحفوظة مسبقاً 
            if filePath and filePath ~= "" then -- نتأكد إن اللاعب محدد إسم الصورة 
                guiStaticImageLoadImage ( img, filePath ); -- نسوي لود للصورة المطلوبة 
            end 
        end 
    end 
); 

Link to comment
filePatch

filePath = مسار الملف

--

v,i

ترتيبها يكون كذا i, v

و

i = عدد القيم

v = القيم

--

[1]

[2]

لاحظ إني عامل داخل جدول الصورة 3 جداول أخرى

وأحين أمبي أجيب القيمة الأولى من كل من جدول

ف راح أستخدم v [ 1 ]

وف نفس الحالة إذا بغيت القيمة الثانية

ف راح أستخدم v [ 2 ]

--

وهنا وش تقصد نسوي لود guiStaticImageLoadImage

يعني نعمل تحميل جديد للصورة عشان تظهر صورة أخرى

--

وممكن تخلي كود للقريد ليست حقي ظ

إطرح أكوادك وأضبطه لك : )

Link to comment

اخي جعفر الكود غير شغال

انا سويت كلشي صح وهذا كودي التجريبي

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
GUIEditor.window[1] = guiCreateWindow(217, 37, 369, 454, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.gridlist[1] = guiCreateGridList(59, 52, 268, 194, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "asd", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(GUIEditor.gridlist[1]) 
end 
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "صورة رقم واحد", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "صورة رقم 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "صورة رقم 3", false, false) 
  
ImgTable = { 
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 55, 270, 267, 174, "img1.png", false ); 
guiSetVisible ( img, false ); 
  
for i, v in ipairs ( ImgTable ) do 
    local row = guiGridListAddRow ( gridlist ); 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
end 
    
addEventHandler ( "onClientGUIClick", root, 
    function (  ) 
        if source == gridlist then 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
            if filePath and filePath ~= "" then 
                guiStaticImageLoadImage ( img, filePath ); 
            end 
        end 
    end 
); 

Link to comment

ناقص إند

  
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
GUIEditor.window[1] = guiCreateWindow(217, 37, 369, 454, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.gridlist[1] = guiCreateGridList(59, 52, 268, 194, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "asd", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(GUIEditor.gridlist[1]) 
end 
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "صورة رقم واحد", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "صورة رقم 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "صورة رقم 3", false, false) 
  
ImgTable = { 
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 55, 270, 267, 174, "img1.png", false ); 
guiSetVisible ( img, false ); 
  
for i, v in ipairs ( ImgTable ) do 
    local row = guiGridListAddRow ( gridlist ); 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
end 
    
addEventHandler ( "onClientGUIClick", root, 
    function (  ) 
        if source == gridlist then 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
            if filePath and filePath ~= "" then 
                guiStaticImageLoadImage ( img, filePath ); 
            end 
        end 
    end 
end 
) 
  

Link to comment

ناقص إند

  
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
GUIEditor.window[1] = guiCreateWindow(217, 37, 369, 454, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.gridlist[1] = guiCreateGridList(59, 52, 268, 194, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "asd", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(GUIEditor.gridlist[1]) 
end 
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "صورة رقم واحد", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "صورة رقم 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "صورة رقم 3", false, false) 
  
ImgTable = { 
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 55, 270, 267, 174, "img1.png", false ); 
guiSetVisible ( img, false ); 
  
for i, v in ipairs ( ImgTable ) do 
    local row = guiGridListAddRow ( gridlist ); 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
end 
    
addEventHandler ( "onClientGUIClick", root, 
    function (  ) 
        if source == gridlist then 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
            if filePath and filePath ~= "" then 
                guiStaticImageLoadImage ( img, filePath ); 
            end 
        end 
    end 
end 
) 
  

الاند حقتك خربت اللوحة خخخ

مو راضية تشتغل

Link to comment

جرب

    GUIEditor = { 
        gridlist = {}, 
        window = {}, 
        button = {} 
    } 
    GUIEditor.window[1] = guiCreateWindow(217, 37, 369, 454, "", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
      
    GUIEditor.gridlist[1] = guiCreateGridList(59, 52, 268, 194, false, GUIEditor.window[1]) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "asd", 0.9) 
    for i = 1, 3 do 
        guiGridListAddRow(GUIEditor.gridlist[1]) 
    end 
    guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "صورة رقم واحد", false, false) 
    guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "صورة رقم 2", false, false) 
    guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "صورة رقم 3", false, false) 
      
    ImgTable = { 
    { "img1", "img1.png" }; 
    { "img2", "img2.png" }; 
    { "img3", "img3.png" }; 
    -- { "imgName, "filePath" }; 
    }; 
      
    img = guiCreateStaticImage ( 55, 270, 267, 174, "img1.png", false ); 
    guiSetVisible ( img, false ); 
      
    for i, v in ipairs ( ImgTable ) do 
        local row = guiGridListAddRow ( gridlist ); 
        guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
        guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
    end 
        
    addEventHandler ( "onClientGUIClick", root, 
        function (  ) 
            if source == gridlist then 
                if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
                local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
                if filePath and filePath ~= "" then 
                    guiStaticImageLoadImage ( img, filePath ); 
                end 
            end 
        end 
       ) 

Link to comment

  
  
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
GUIEditor.window[1] = guiCreateWindow(217, 37, 369, 454, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.gridlist[1] = guiCreateGridList(59, 52, 268, 194, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "asd", 0.9) 
for i = 1, 3 do 
    guiGridListAddRow(GUIEditor.gridlist[1]) 
end 
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "صورة رقم واحد", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "صورة رقم 2", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "صورة رقم 3", false, false) 
  
ImgTable = { 
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 55, 270, 267, 174, "img1.png", false ); 
guiSetVisible ( img, false ); 
  
for i, v in ipairs ( ImgTable ) do 
    local row = guiGridListAddRow ( gridlist ); 
    guiGridListSetItemText ( gridlist, row, 1, v [ 1 ], false, false ); 
    guiGridListSetItemData ( gridlist, row, 1, v [ 2 ] ); 
end 
  
addEventHandler ( "onClientGUIClick", root, 
    function (  ) 
        if source == gridlist then 
            if guiGetVisible ( img ) == false then guiSetVisible ( img, true ); end 
            local filePath = guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ); 
            if filePath and filePath ~= "" then 
                guiStaticImageLoadImage ( img, filePath ); 
            end 
        end 
    end 
) 
  
  

تو الآحظ الإند الي اخر السطر :]

االكود صحيح بس انت غلطان يمكن م عرفت تحط الصوره شف الدي بق

Link to comment

شباب خلاص عرفت المشكلة

اللي هي اني نسيت احط اسم القريد ليست حقتي بكود جعفر هههههههههههههههههههههه

وما كان لازم اني اضيف اي رو لان اللي في التيبل هم روهات

مششكورين شباب تعبتكم على مشكلة كلنا ما انتبهنا عليه

Link to comment

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...