Jump to content

لوحة فيها اسماء اللاعبين


Recommended Posts

local List = اسم القريد ليست 
addEventHandler("onClientResourceStart", resourceRoot, 
function  (       ) 
        local players = getElementsByType("player") 
              for _ , player in ipairs ( players ) do 
                     local name = string.gsub( getPlayerName( player ), "#%x%x%x%x%x%x", "" ) 
                     local row = guiGridListAddRow( List ) 
                     guiGridListSetItemText( List, row, 1, name ) 
            end 
end    ) 

nike

Link to comment
local List = اسم القريد ليست 
addEventHandler("onClientResourceStart", resourceRoot, 
function  (       ) 
        local players = getElementsByType("player") 
              for _ , player in ipairs ( players ) do 
                     local name = string.gsub( getPlayerName( player ), "#%x%x%x%x%x%x", "" ) 
                     local row = guiGridListAddRow( List ) 
                     guiGridListSetItemText( List, row, 1, name ) 
            end 
end    ) 

nike

شكرا

Link to comment
local List = اسم القريد ليست 
addEventHandler("onClientResourceStart", resourceRoot, 
function  (       ) 
        local players = getElementsByType("player") 
              for _ , player in ipairs ( players ) do 
                     local name = string.gsub( getPlayerName( player ), "#%x%x%x%x%x%x", "" ) 
                     local row = guiGridListAddRow( List ) 
                     guiGridListSetItemText( List, row, 1, name ) 
            end 
end    ) 

nike

شكرا

العفو :D

Link to comment
  • 3 weeks later...
local List = اسم القريد ليست 
addEventHandler("onClientResourceStart", resourceRoot, 
function  (       ) 
        local players = getElementsByType("player") 
              for _ , player in ipairs ( players ) do 
                     local name = string.gsub( getPlayerName( player ), "#%x%x%x%x%x%x", "" ) 
                     local row = guiGridListAddRow( List ) 
                     guiGridListSetItemText( List, row, 1, name ) 
            end 
end    ) 

nike

شكرا

العفو :D

اخي جربتها ما اشتغلت

Link to comment

تفضل

function list() 
    guiGridListClear(playe) 
    for id, players in ipairs (getElementsByType("player")) do 
        local row = guiGridListAddRow(playe) 
        guiGridListSetItemText(playe, row, 1, getPlayerName(players), false, false) 
        guiGridListSetItemColor ( playe, row, 1, 0, 250, 154, 255 ) 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, list) 
addEventHandler("onClientPlayerJoin", getRootElement(), list) 
addEventHandler("onClientPlayerQuit", getRootElement(), list) 
addEventHandler("onClientPlayerChangeNick", getRootElement(), list) 

Link to comment

كود يزن خاطئ

وتم وضع طلب مثل هذا من قبل

You can use this and be sure to replace gridList and column with your.
function updateList(old, new) 
    if eventName == "onClientPlayerJoin"  then 
        local row = guiGridListAddRow(gridList) 
        guiGridListSetItemText(gridList, row, column, getPlayerName(source), false, false) 
    elseif eventName == "onClientPlayerQuit"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == getPlayerName(source) then 
                guiGridListRemoveRow(gridList, i) 
            end 
        end 
    elseif eventName == "onClientPlayerChangeNick"  then 
        for i=0, guiGridListGetRowCount(gridList) do 
            if guiGridListGetItemText(gridList, i, column) == old then 
                guiGridListSetItemText(gridList, i, column, new, false, false) 
            end 
        end 
    end 
end 
addEventHandler("onClientPlayerJoin", root, updateList) 
addEventHandler("onClientPlayerQuit", root, updateList) 
addEventHandler("onClientPlayerChangeNick", root, updateList) 

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

        end

    end

end

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