Jump to content

سؤال !


Recommended Posts

إستبدل الـ ,

gridlist

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

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

ImgTable = {  
{ "img1", "img1.png" }; 
{ "img2", "img2.png" }; 
{ "img3", "img3.png" }; 
-- { "imgName, "filePath" }; 
}; 
  
img = guiCreateStaticImage ( 200, 200, 100, 100, ImgTable [ 1 ][ 2 ], 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

الله يعطيك العافيةة !

بس بغيت لو فتح النافذه يطلع له صورةة X

يعني بدون مايضغط على رو

جربت احط صورهه بس مانفع لو اضغط على بتطلع الصوره فوق الـ x

Link to comment

+

جتني مشكلة ثانية اذا ضغطت على صورة وضغطت على رو ثاني ماتروح الصورة الاولى

GUIEditor = { 
    button = {}, 
    staticimage = {} 
} 
        Window = guiCreateWindow(281, 109, 320, 393, "- [ Health Shop ] - ", false) 
        guiWindowSetSizable(Window, false) 
        guiSetAlpha(Window, 1.00) 
  
        GridList = guiCreateGridList(9, 20, 159, 363, false, Window) 
        Col = guiGridListAddColumn(GridList, "Menu", 0.5) 
        Col = guiGridListAddColumn(GridList, "Price", 0.5) 
        for i = 1, 8 do 
       row = guiGridListAddRow(GridList) 
        end 
        guiGridListSetItemText(GridList, 0, 1, "Health1", false, false) 
        guiGridListSetItemText(GridList, 0, 2, "100", false, false) 
        guiGridListSetItemText(GridList, 1, 1, "Health2", false, false) 
        guiGridListSetItemText(GridList, 1, 2, "500", false, false) 
        guiGridListSetItemText(GridList, 2, 1, "Health3", false, false) 
        guiGridListSetItemText(GridList, 2, 2, "1000", false, false) 
        guiGridListSetItemText(GridList, 2, 2, "Health4", false, false) 
        guiGridListSetItemText(GridList, 2, 2, "1500", false, false) 
        guiGridListSetItemText(GridList, 3, 1, "Health5", false, false) 
        guiGridListSetItemText(GridList, 3, 2, "2000", false, false) 
        guiGridListSetItemText(GridList, 4, 1, "Health6", false, false) 
        guiGridListSetItemText(GridList, 4, 2, "2500", false, false) 
        Button = guiCreateButton(178, 351, 132, 32, "= [ Close ] =", false, Window) 
        guiSetProperty(Button, "NormalTextColour", "FFAAAAAA") 
        Button1 = guiCreateButton(178, 305, 132, 32, "= [ Buy ] =", false, Window) 
        guiSetProperty(Button2, "NormalTextColour", "FFAAAAAA")     
        guiSetVisible(Window, true)  
  
  
function hidegui() 
    guiSetVisible(Window, false) 
    showCursor ( false ) 
end 
addEventHandler ( "onClientGUIClick", Button, hidegui, false ) 
  
addEventHandler("onClientGUIClick", guiRoot, 
function() 
    if source == Button1 then 
        local row = guiGridListGetSelectedItem(GridList) 
        if row == 0 then 
            triggerServerEvent("setMyHealth", localPlayer) 
        elseif row == 1 then 
            triggerServerEvent("setMyHealth1", localPlayer) 
        elseif row == 2 then 
            triggerServerEvent("setMyHealth2", localPlayer) 
        elseif row == 3 then 
            triggerServerEvent("setMyHealth3", localPlayer) 
        elseif row == 4 then 
            triggerServerEvent("setMyHealth4", localPlayer) 
        end 
    end 
end) 
  
    ImgTable = { 
    { "health", "health1.png" }; 
    { "health2", "health2.png" }; 
    { "img3", "img3.png" }; 
    -- { "imgName, "filePath" }; 
    }; 
      
    img = guiCreateStaticImage ( 171, 21, 139, 257, ImgTable [ 1 ][ 2 ], false, Window ); 
    guiSetVisible ( img, false ); 
      
    for i, v in ipairs ( ImgTable ) do 
        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

رتبتهم لك واختصرت عليك بعض الاكواد

Note : غير مجرب

GUIEditor = { 
    button = {}, 
    staticimage = {} 
} 
addEventHandler('onClientResourceStart',resourceRoot, 
function () 
  
    Window = guiCreateWindow(281, 109, 320, 393, "- [ Health Shop ] - ", false) 
    guiWindowSetSizable(Window, false) 
    guiSetAlpha(Window, 1.00) 
     
    GridList = guiCreateGridList(9, 20, 159, 363, false, Window) 
    Col = guiGridListAddColumn(GridList, "Menu", 0.5) 
    Col = guiGridListAddColumn(GridList, "Price", 0.5) 
     
    Button = guiCreateButton(178, 351, 132, 32, "= [ Close ] =", false, Window) 
    guiSetProperty(Button, "NormalTextColour", "FFAAAAAA") 
    Button1 = guiCreateButton(178, 305, 132, 32, "= [ Buy ] =", false, Window) 
    guiSetProperty(Button1, "NormalTextColour", "FFAAAAAA")     
    guiSetVisible(Window, true) 
     
     
    ImgTable = { 
        { "health", "health1.png" }; 
        { "health2", "health2.png" }; 
        { "img3", "img3.png" }; 
        -- { "imgName, "filePath" }; 
    }; 
     
    for i, v in ipairs ( ImgTable ) do 
        row = guiGridListAddRow(GridList) 
        guiGridListSetItemText ( GridList, row, 1, v [ 1 ], false, false ); 
        guiGridListSetItemData ( GridList, row, 1, v [ 2 ] ); 
    end 
     
     
    img = guiCreateStaticImage ( 171, 21, 139, 257, ImgTable [ 1 ][ 2 ], false, Window ); 
    guiSetVisible ( img, false ); 
end) 
  
  
  
  
addEventHandler ( "onClientGUIClick", guiRoot, 
    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 
             
        elseif source == Button then  
         
            guiSetVisible(Window, false) 
            showCursor ( false ) 
             
        elseif source == Button1 then 
         
            local row = guiGridListGetSelectedItem(GridList) 
            if row == 0 then 
                triggerServerEvent("setMyHealth", localPlayer) 
            elseif row == 1 then 
                triggerServerEvent("setMyHealth1", localPlayer) 
            elseif row == 2 then 
                triggerServerEvent("setMyHealth2", localPlayer) 
            elseif row == 3 then 
                triggerServerEvent("setMyHealth3", localPlayer) 
            end 
             
        end 
    end 
); 

Link to comment

-_-

انا حاط فوق

guiGridListSetItemText(GridList, 4, 1, "Health6", false, false)

guiGridListSetItemText(GridList, 4, 2, "2500", false, false)

وانت مسحتها

وحطيت بالتيبل حقت الصور

Health health1.png

يطلع الاسم Health بس ابي اطلع السعر بعد !

Link to comment

لوووووول وليه زعلان طيب؟

يمديك تسويه بهذا الشكل , اكوادك الي انت كنت مسويها للسعر كثيره ع الفاضي

:wink::mrgreen:

GUIEditor = { 
    button = {}, 
    staticimage = {} 
} 
addEventHandler('onClientResourceStart',resourceRoot, 
function () 
  
    Window = guiCreateWindow(281, 109, 320, 393, "- [ Health Shop ] - ", false) 
    guiWindowSetSizable(Window, false) 
    guiSetAlpha(Window, 1.00) 
     
    GridList = guiCreateGridList(9, 20, 159, 363, false, Window) 
    Col = guiGridListAddColumn(GridList, "Menu", 0.5) 
    Col = guiGridListAddColumn(GridList, "Price", 0.5) 
     
    Button = guiCreateButton(178, 351, 132, 32, "= [ Close ] =", false, Window) 
    guiSetProperty(Button, "NormalTextColour", "FFAAAAAA") 
    Button1 = guiCreateButton(178, 305, 132, 32, "= [ Buy ] =", false, Window) 
    guiSetProperty(Button1, "NormalTextColour", "FFAAAAAA")     
    guiSetVisible(Window, true) 
     
     
    ImgTable = { 
        { "health",2500, "health1.png" }; 
        { "health2",300, "health2.png" }; 
        { "img3",5400, "img3.png" }; 
        -- { "imgName,price, "filePath" }; 
    }; 
     
    for i, v in ipairs ( ImgTable ) do 
        row = guiGridListAddRow(GridList) 
        guiGridListSetItemText ( GridList, row, 1, v [ 1 ], false, false ); 
        guiGridListSetItemData ( GridList, row, 1, v [ 3 ] ); 
        guiGridListSetItemText ( GridList, row, 2, v [ 2 ], false, false ); 
    end 
     
     
    img = guiCreateStaticImage ( 171, 21, 139, 257, ImgTable [ 1 ][ 3 ], false, Window ); 
    guiSetVisible ( img, false ); 
end) 
  
  
  
  
addEventHandler ( "onClientGUIClick", guiRoot, 
    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 
             
        elseif source == Button then  
         
            guiSetVisible(Window, false) 
            showCursor ( false ) 
             
        elseif source == Button1 then 
         
            local row = guiGridListGetSelectedItem(GridList) 
            if row == 0 then 
                triggerServerEvent("setMyHealth", localPlayer) 
            elseif row == 1 then 
                triggerServerEvent("setMyHealth1", localPlayer) 
            elseif row == 2 then 
                triggerServerEvent("setMyHealth2", localPlayer) 
            elseif row == 3 then 
                triggerServerEvent("setMyHealth3", localPlayer) 
            end 
             
        end 
    end 
); 
  
  

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