Jump to content

مساعدة بسيطة #


Mr.CoR

Recommended Posts

سلاام عليكم

انا الحين جالس اسوي لوحة للشرطة

بس في مشكلة واجهتني في وظيفه عناد الي تحول قيم القريد ليست إلى أسماء لاعبين

وظيفة تغيير قيَم القريد لست إلى أسماء اللاعبين ..
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
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, string.gsub ( getPlayerName ( v ), "#%x%x%x%x%x%x", "" ), 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 ' 

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, string.gsub ( getPlayerName ( v ), "#%x%x%x%x%x%x", "" ), 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 ' 

بس لو بيستخدم وظيفة

getPlayerFromName 

لأزم يحط

guiGridListSetItemData 
Link to comment
^ removeColorCoding

من وين تجيب الاكواد انت ؟ ماشاء الله عليك محترف

ما فيه كود بالبرمجه اسمه removeColorCoding -_-

يمكن جابو من مود نسخ ولصق وهو اعتقد انه فنكشن

لكن هو عباره

function removeColorCoding( )

لا تنسخ شي قبل ما تعرف وايش يسوي :D

Edited by Guest
Link to comment
^ removeColorCoding

من وين تجيب الاكواد انت ؟ ماشاء الله عليك محترف

ما فيه كود بالبرمجه اسمه removeColorCoding -_-

يمكن جابو من مود نسخ ولصق وهو اعتقد انه فنكشن

لكن هو عباره

function removeColorCoding( )

لا تنسخ شي قبل ما تعرف وايش يسوي :D

الاختصار يوسفل فانشكن ض1

ياميزو هذي آخرت راعيين النسخ واللصق :lol:

Link to comment
^ removeColorCoding

من وين تجيب الاكواد انت ؟ ماشاء الله عليك محترف

ما فيه كود بالبرمجه اسمه removeColorCoding -_-

يمكن جابو من مود نسخ ولصق وهو اعتقد انه فنكشن

لكن هو عباره

function removeColorCoding( )

لا تنسخ شي قبل ما تعرف وايش يسوي :D

الاختصار يوسفل فانشكن ض1

ياميزو هذي آخرت راعيين النسخ واللصق :lol:

+1

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