Jump to content

[HELP] How to get map list to GridList


John_Scott

Recommended Posts

Posted

Server side functions:

getResources -- To get resources list. 
getResourceInfo -- To get the resource type. 
triggerClientEvent -- To trigger the maps table to the client side. 

Client side functions:

addEvent 
addEventHandler 
guiGridListAddRow 
guiGridListSetItemText 

Posted
function searchMaps(mapSearch) 
  
    for i,v in ipairs(getResources()) do 
        if(getResourceInfo(v, "type") == "map") and (getResourceInfo(v, "gamemodes") == "race")then 
            if(string.find(getResourceInfo(v, "name"), mapSearch) or mapSearch == "")then 
            triggerClientEvent(source, "YOUREVENT", source, getResourceInfo(v, "name")) 
        end 
        end  
    end 
end 
addEvent("searchMaps", true) 
addEventHandler("searchMaps", root, searchMaps) 

Posted
No offense, but that's a bad way to do it.

You better send the maps table to client side and then search on the client side.

I'm just making it as easy as possible for myself when giving out codes ;)

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