Jump to content

طلب كود


Recommended Posts

addEventHandler("onClientGUIChanged",root, 
    function () 
        if ( source == edit ) then 
            local text = guiGetText(edit) 
            if ( text == "" ) then 
                putAllPlayersInList() 
            else 
                guiGridListClear(grid) 
                for i,v in ipairs(getElementsByType("player")) do 
                    local name = getPlayerName(v) 
                    if string.find(name,text) then 
                        local row = guiGridListAddRow(grid) 
                        guiGridListSetItemText(grid,row,1,name,false,false) 
                        guiGridListSetItemColor(grid,row,1,255,255,0) 
                    end 
                end 
            end 
        end 
    end 
) 
  
Link to comment
function clientsideResourceStart () 
        if ( column ) then 
                for id, playeritem in ipairs(getElementsByType("player")) do  
                        local row = guiGridListAddRow ( PlayersGrid ) 
                        guiGridListSetItemText ( PlayersGrid, row, column, getPlayerName ( playeritem ), false, false ) 
                        setTimer ( guiGridListClear, 5000, 1, PlayersGrid )  
                end 
        end 
end 
addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart ) 

Link to comment
وظيفة تغيير قيَم القريد لست إلى أسماء اللاعبين ..
changeGridListItemToPlayersName = function ( GridList, Column ) 
    if GridList and Column then -- Check Parematers 
        if getElementType ( GridList ) == "gui-gridlist" then -- Check The Type of ' GridList ' 
            if guiGridListClear ( GridList ) then -- Clear GridList 
                for i, v in next, getElementsByType ( "player" ) do -- Get Everything by Type ' player '  
                    local Row = guiGridListAddRow ( GridList ) -- Add Row 
                    guiGridListSetItemText ( GridList, Row, Column, getPlayerName ( v ), false, false ); -- Set New Values 
                end; -- end of ' for ' 
            end; -- end of ' clear gridlist ' 
        end; -- end of ' check gridlist type ' 
    end; -- end of ' check parematers 
end; -- end of ' function ' 

مثآل :

wnd = guiCreateWindow ( 100, 100, 400, 400, "Test", false ); -- Create Window 
grid = guiCreateGridList ( 25, 30, 350, 350, false, wnd ); -- Create Gridlist 
col = guiGridListAddColumn ( grid, "Players", 0.9 ); -- Create Column 
changeGridListItemToPlayersName ( grid, col ); -- Set Gridlist Values 

استعمل هذا الكود من قبل عناد

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