Jump to content

طلب كود gridlist


Recommended Posts

Posted

سلام عليكم

اخواني اريد كود gridlist

حق اللاعبين او اي شيء

و ارجو شرحه

و كيفية التعامل معه

و شكرا

Posted

يعني ما فهمت تبي هيك ؟؟

وش فيكم

يا اخوي انا اعمل نوافذ بال guieidtor

و اعمل

gridlist بيها

فهمني ؟؟؟

ذا الي ابي اوصل اليه

واضح ولا لا

Posted

يا شباب تكفون ابي الكود بس موب الي بالويكي

ابيه يعني موب كامل

يعني هو ما يفهم كثير بالويكي

اصلا ما صعب مره

ما قدرتله

Posted

يا تابل وش فيك

انت تفهم بالعربي ولا لا

قتلك الكود ما فهمت له

ترا كيف يعني احطه و يشتغل

؟؟؟

ابي شرح

Posted

شكلك تفهم بنقالي

معليه

بنسخ لك الكود هنا

function clientsideResourceStart () 
        local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create the grid list 
        local column = guiGridListAddColumn( playerList, "Player", 0.85 ) -- Create a 'players' column in the list 
        if ( column ) then -- If the column was successfully created 
                for id, playeritem in ipairs(getElementsByType("player")) do  
                --Loop through all the players, adding them to the table 
                        local row = guiGridListAddRow ( playerList ) 
                        guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) 
                end 
        end 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(), clientsideResourceStart ) 

Posted

يب و بعدين

انا مسوي grid list

في النافذة حقي

بس ابي كود اللي يضهر اللاعبين

افهم انا وضحت لك اكثر ؟؟

Posted
for _,v in ipairs( getElementsByType( 'player' ) ) do 
    local row = guiGridListAddRow( إسمـ الجرد حقك ) 
    guiGridListSetItemText( إسمـ الجرد حقك, row, column, getPlayerName( v ), false, false ) 
end 

Posted
for _,v in ipairs( getElementsByType( 'player' ) ) do 
    local row = guiGridListAddRow( إسمـ الجرد حقك ) 
    guiGridListSetItemText( إسمـ الجرد حقك, row, column, getPlayerName( v ), false, false ) 
end 

كودك كيف يحدث الاعبين؟

Posted

ضيفه لفتح النافذة

function getAllPlayers ( ) 
    for _,v in ipairs( getElementsByType( 'player' ) ) do 
        local row = guiGridListAddRow( إسمـ الجرد حقك ) 
        guiGridListSetItemText( إسمـ الجرد حقك, row, column, getPlayerName( v ), false, false ) 
    end 
end 
  
  
function open ( ) 
    if ( guiGetVisible ( إسمـ النافذة ) ) then 
        guiSetVisible( إسمـ النافذة, false ) 
        showCursor( false ) 
    else 
        guiSetVisible( إسمـ النافذة, true ) 
        showCursor( true )      
        getAllPlayers ( ) 
    end 
end 
bindKey( الزر, 'down', open ) 

Posted

لا انا اعرف

بس ممكن سؤال ؟؟

for _,v in ipairs( getElementsByType( 'player' ) ) do 
    local row = guiGridListAddRow( إسمـ الجرد حقك ) 
    guiGridListSetItemText( إسمـ الجرد حقك, row, column, getPlayerName( v ), false, false ) 
end 

في مكان اسم الجرد حقك ؟؟

اكتب اسم الـ الاسم حقها

Posted
ضيفه لفتح النافذة
function getAllPlayers ( ) 
    for _,v in ipairs( getElementsByType( 'player' ) ) do 
        local row = guiGridListAddRow( إسمـ الجرد حقك ) 
        guiGridListSetItemText( إسمـ الجرد حقك, row, column, getPlayerName( v ), false, false ) 
    end 
end 
  
  
function open ( ) 
    if ( guiGetVisible ( إسمـ النافذة ) ) then 
        guiSetVisible( إسمـ النافذة, false ) 
        showCursor( false ) 
    else 
        guiSetVisible( إسمـ النافذة, true ) 
        showCursor( true )      
        getAllPlayers ( ) 
    end 
end 
bindKey( الزر, 'down', open ) 

بيكرر الاسم في القريد وبيسبب لاق استخدم :

guiGridListClear 

Posted
wnd1 = guiCreateWindow(208,141,290,290,"wnd test",false) 
  
player = guiCreateGridList(14,39,144,230,false,wnd1) 
  
guiGridListSetSelectionMode(player,2) 
  
  
  
  
for _,v in ipairs( getElementsByType( 'player' ) ) do 
    local row = guiGridListAddRow( player ) 
    guiGridListSetItemText( player, row, column, getPlayerName( v ), false, false ) 
end 
  

ذا كودي تجربة للكود بس

ما اشتغلي ؟؟

Posted

شوف لاحظ في ذا الكود وجود

putPlayers()

ذي انا محطيها مع فتح النافذه يعني كل ما فتح النافذه يحط الاعبين في اللسته

شوف المثال و ان شاء الله تفهم

wnd = guiCreateWindow(0,0,1,1,"Test Window",true) 
grid = guiCreateGridList(0,0.05,0.99,0.99,true,wnd) 
guiGridListAddColumn(grid,"Players",0.95) 
guiSetVisible(wnd,false) 
  
bindKey("F3","down", 
    function () 
        if guiGetVisible(wnd) then 
            guiSetVisible(wnd,false) 
            showCursor(false) 
        else 
            guiSetVisible(wnd,true) 
            showCursor(true) 
            putPlayers() 
        end 
    end 
) 
  
function putPlayers() 
    guiGridListClear(grid) 
    for i,player in ipairs(getElementsByType("player")) do 
        local row = guiGridListAddRow(grid) 
        guiGridListSetItemText(grid,row,1,getPlayerName(player),false,false) 
    end 
end 
  

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