Raised This Month: $ Target: $400
 0% 

advcommands mapcfg & workshop maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 03-05-2013 , 16:58   advcommands mapcfg & workshop maps
Reply With Quote #1

I'm trying to very simply mod the advcommands plugin's mapcfg to work with workshop maps. I just want the basename, I don't want to make the workshop/id dir for each map..

The plugin already includes smlib and I think this is what I need, I just don't know how to implement it. I come from mIRC scripting.. I don't understand the buffer and size for the function.

stock bool:File_GetBaseName(const String:path[], String:buffer[], size)

this is their code:
(I need the basename of map instead of map for %s)

new String:map[64];
GetCurrentMap(map, sizeof(map));
InsertServerCommand("exec mapcfg/%s.cfg", map);
ServerExecute();


bonus: a check to see if the cfg even exists before doing the InsertServerCommand/ServerExecute.

Last edited by hamilton5; 03-15-2013 at 22:10.
hamilton5 is offline
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 08-26-2013 , 03:39   Re: advcommands mapcfg & workshop maps
Reply With Quote #2

Code:
    new String:map[64]; new String:mapBase[32]; new String:mapString[64];
    GetCurrentMap(map, sizeof(map));
    File_GetBaseName(map, mapBase, sizeof(mapBase));
    Format(mapString, 64, "cfg/mapcfg/%s.cfg", mapBase);
    if (FileExists(mapString)) {
        ServerCommand("exec mapcfg/%s", mapBase);
    }

Last edited by hamilton5; 08-26-2013 at 04:04.
hamilton5 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-26-2013 , 13:52   Re: advcommands mapcfg & workshop maps
Reply With Quote #3

https://forums.alliedmods.net/showthread.php?t=62087
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 08-26-2013 , 16:56   Re: advcommands mapcfg & workshop maps
Reply With Quote #4

I've never been able to get it to work with csgo.. I'm not sure they have enabled it yet?
hamilton5 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-26-2013 , 17:33   Re: advcommands mapcfg & workshop maps
Reply With Quote #5

Quote:
Originally Posted by hamilton5 View Post
I've never been able to get it to work with csgo.. I'm not sure they have enabled it yet?
I think they do... although if it's like CS:S, the folder is maps/cfg/

Having said that, they may be encouraging people to use the gamemode config files instead.
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 18:07.


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