xTravax Posted July 2, 2015 Share Posted July 2, 2015 hi i got a problem guyz i am using this sort of function to load DM maps but it dont work, it load all other maps even DD and Race function LoadDMMaps() for _,resource in pairs(getResources()) do if getResourceInfo(resource,"type") == "map" then if getResourceInfo(resource,"gamemodes") == "race" then if string.find(getResourceInfo(resource,"name"),"[DM]",1) then local MapName = getMapName(resource); local MapAuthor = getMapAuthor(resource); table.insert(Maps.DM,{resource,MapName,MapAuthor}); outputDebugString("loading dm maps... count: "..(#Maps.DM),0,0,187,255); end; end; end; end; end; setTimer(LoadDMMaps,50,1) why does this happen? it's suppose to put in table only maps which have [DM] in their names... Link to comment
Death Posted July 3, 2015 Share Posted July 3, 2015 try this function LoadDMMaps() for _,resource in pairs(getResources()) do if getResourceInfo(resource,"type") == "map" then if getResourceInfo(resource,"gamemodes") == "race" then if string.find(getResourceInfo(resource,"name"),"[DM]",1, true) then local MapName = getMapName(resource); local MapAuthor = getMapAuthor(resource); table.insert(Maps.DM,{resource,MapName,MapAuthor}); outputDebugString("loading dm maps... count: "..(#Maps.DM),0,0,187,255); end; end; end; end; end; setTimer(LoadDMMaps,50,1) Link to comment
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