View Single Post
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