Jump to content

help me gridlist


RdX

Recommended Posts

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

انا اليوم سويت شيء سيط لاأاكن المشكله منيب عارف كيف اخليه يطلع في Gridlist

mapGridList = guiCreateGridList ( 20, 50, 191, 320, false, mapwin ); 
    guiGridListSetSelectionMode ( mapGridList, 2 ); 
    gColumn = guiGridListAddColumn ( mapGridList, "Name:", 0.85 ); 
    guiWindowSetSizable ( mapwin, false ); 
  
    function getRaceMaps() 
    local maps = {} 
    for _,res in ipairs(getResources()) do 
        if getResourceInfo(res,"type") == "map" then 
            if getResourceInfo(res,"gamemodes") == "race" then 
                table.insert(maps,getResourceInfo(res,"name")) 
            end 
        end 
    end 
    return maps 
end 

ذا القريد لست و لا الكود حق الي يطلع مابات الريس

لأأكن ما عرفت كيف اربطها مع بعض فأأ سووو خير و علموني <3

Link to comment

* Client Side !

bindKey( "F4", "down", function (  ) 
     triggerServerEvent( "getMaps", localPlayer ) 
end ) 
  
addEvent( "UpMapsToGrid", true ) 
addEventHandler( "UpMapsToGrid", root, function( allMaps ) 
        guiGridListClear( mapGridList ) 
        for _,v in ipairs( allMaps ) do 
          local row = guiGridListAddRow( mapGridList ) 
          guiGridListSetItemText( mapGridList, row, 1, tostring( v ), false, false ) 
       end 
end )    

* Server Side !

function getRaceMaps( element ) 
    local maps = {} 
    for _,res in ipairs(getResources()) do 
        if getResourceInfo(res,"type") == "map" then 
            if getResourceInfo(res,"gamemodes") == "race" then 
                 table.insert(maps,getResourceInfo(res,"name")) 
              end 
             triggerClientEvent( element, "UpMapsToGrid", element, maps ) 
         end 
     end 
end 
  
  
addEvent( "getMaps", true ) 
addEventHandler( "getMaps", root, function(  ) 
      getRaceMaps( source ) 
end )     
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...