John_Scott Posted December 24, 2012 Posted December 24, 2012 Hy! Please help me in the Map listing. I would like to writeing the map list to GUI gridlist. Thanks for help!
Castillo Posted December 24, 2012 Posted December 24, 2012 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
Techial Posted December 24, 2012 Posted December 24, 2012 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)
Castillo Posted December 24, 2012 Posted December 24, 2012 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.
Techial Posted December 24, 2012 Posted December 24, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now