Jump to content

سسؤال


Recommended Posts

السلام عليكم ورحمة الله وبركاته

ي شباب

انا بسوي سكربت

وسويت قريد لست

ومسوي كولمن

كاتب Player Name

بس المشكلة

كيف آخليهم يطلعون بالقريد لست

وابي فنكشنات ربط زر give

باعطاء موتر

و Destroy بسحب موتر

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 

الطلب الثاني ,,

تقصد ان اذا حدد على row في القريد لست وضغط زر ؟؟

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 

الطلب الثاني ,,

تقصد ان اذا حدد على row في القريد لست وضغط زر ؟؟

الثاني

تربط الازرار بامر

كذا يصير الكود صح ؟

  
wnd = guiCreateWindow(173, 131, 463, 391, "Give Car Panel", false) 
guiWindowSetSizable(wnd, false) 
LBL1 = guiCreateLabel(10, 366, 104, 15, "اعطاء السيارات", false, wnd) 
guiLabelSetColor(LBL1, 254, 0, 0) 
Grd1 = guiCreateGridList(9, 23, 348, 343, false, wnd) 
changeGridListItemToPlayersName ( Grd1, wnd ) 
guiGridListAddColumn(Grd1, "Player Name", 0.9) 
Btn1 = guiCreateButton(362, 48, 91, 47, "Give", false, wnd) 
guiSetProperty(Btn1, "NormalTextColour", "FFAAAAAA") 
Btn2 = guiCreateButton(362, 105, 91, 47, "Destroy", false, wnd) 
guiSetProperty(Btn2, "NormalTextColour", "FFAAAAAA") 
  

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