Raised This Month: $51 Target: $400
 12% 

[CS:GO]Getting the Correct Workshop Map Name


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-14-2014 , 12:53   Re: [CS:GO]Getting the Correct Workshop Map Name
Reply With Quote #11

I modified the workshop functions in the other thread to copy the original string to destination if it doesn't find a directory delimiter, which should make this code work properly:

PHP Code:
ParseZoneConfig()
{
    
decl String:sConfigFile[PLATFORM_MAX_PATH], String:inputMap[PLATFORM_MAX_PATH], String:sMap[64];
    
GetCurrentMap(inputMapsizeof(inputMap));
    
RemoveMapPath(inputMapsMapsizeof(sMap));
    
BuildPath(Path_SMsConfigFilesizeof(sConfigFile), "configs/antirush/%s.cfg"sMap);
    
    if(!
FileExists(sConfigFile))
    {
        
LogMessage("Current Path: %s"sConfigFile);
        return;
    }

__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 10-14-2014 , 13:30   Re: [CS:GO]Getting the Correct Workshop Map Name
Reply With Quote #12

Thank you Powerlord. I'm not a coder so I supposed that if path doesn't contain /workshop/ string, nothing will happen. That's why I was confused with blank return.
__________________
Wilczek is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 10-14-2014 , 14:28   Re: [CS:GO]Getting the Correct Workshop Map Name
Reply With Quote #13

@up
you were right, make sure you update your library cos Powerlord have uploaded new ver. of these.

Last edited by LambdaLambda; 10-14-2014 at 14:28.
LambdaLambda is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-14-2014 , 14:34   Re: [CS:GO]Getting the Correct Workshop Map Name
Reply With Quote #14

Quote:
Originally Posted by Wilczek View Post
Thank you Powerlord. I'm not a coder so I supposed that if path doesn't contain /workshop/ string, nothing will happen. That's why I was confused with blank return.
Well, RemoveMapPath will remove any path, not just workshop paths.

As a general rule, servers usually don't have multiple maps with the same name in different paths and I'm not even sure how CS:GO handles that... I know you can put the map name without the workshop path in both mapgroups and mapcycle.txt.

In fact, the MapEqual command in the same file exists because of that.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 10-14-2014 , 15:53   Re: [CS:GO]Getting the Correct Workshop Map Name
Reply With Quote #15

Quote:
Originally Posted by Powerlord View Post
As a general rule, servers usually don't have multiple maps with the same name in different paths and I'm not even sure how CS:GO handles that... I know you can put the map name without the workshop path in both mapgroups and mapcycle.txt.
I'm not sure too. All I know default maps are being stored in main /csgo/maps folder, and custom maps have additional /workshop/id subfolders. I don't understand why don't they just unify it.
__________________
Wilczek is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode