diff --git a/plugins/admin.sma b/plugins/admin.sma index 7c7bd9ea..75d762b4 100755 --- a/plugins/admin.sma +++ b/plugins/admin.sma @@ -72,7 +72,11 @@ public plugin_init() remove_user_flags(0,read_flags("z")) // Remove 'user' flag from server rights - server_cmd("exec addons/amxx/amxx.cfg") // Execute main configuration file + new configsDir[128] + get_configsdir(configsDir, 127) + server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file + new users_ini_file[128] + format(users_ini_file, 127, "%s/users.ini", configsDir) loadSettings("addons/amxx/configs/users.ini") // Load admins accounts } @@ -109,9 +113,9 @@ public cmdReload(id,level,cid) if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED - new filename[64] - get_basedir(filename,31) - format(filename,63,"%s/configs/users.ini",filename) + new filename[128] + get_configsdir(filename,127) + format(filename,63,"%s/users.ini", filename) g_aNum = 0 loadSettings(filename) // Re-Load admins accounts diff --git a/plugins/admin_mysql.sma b/plugins/admin_mysql.sma index 73208b03..2567e052 100755 --- a/plugins/admin_mysql.sma +++ b/plugins/admin_mysql.sma @@ -81,8 +81,10 @@ public plugin_init() remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights - server_cmd("exec addons/amxx/amxx.cfg") - server_cmd("exec addons/amxx/configs/mysql.cfg;amx_sqladmins") + new configsDir[128] + get_configsdir(configsDir, 127) + server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file + server_cmd("exec %s/mysql.cfg;amx_sqladmins", configsDir) } public adminSql() { diff --git a/plugins/cmdmenu.sma b/plugins/cmdmenu.sma index b959f41e..2cf5d884 100755 --- a/plugins/cmdmenu.sma +++ b/plugins/cmdmenu.sma @@ -90,18 +90,22 @@ public plugin_init() { register_plugin("Commands Menu","0.16","AMXX Dev Team") + new configsDir[64]; + get_configsdir(configsDir, 63); new config[64] for(new a = 0; a < MAX_CMDS_LAYERS; ++a) { register_menucmd(register_menuid( g_cmdMenuName[ a ] ),1023,"actionCmdMenu") register_clcmd( g_cmdMenuCmd[ a ] ,"cmdCmdMenu",ADMIN_MENU, g_cmdMenuHelp[ a ] ) - format(config,63,"addons/amxx/configs/%s",g_cmdMenuCfg[a]) - loadCmdSettings(config,a) + format(config,63,"%s/%s",configsDir,g_cmdMenuCfg[a]) + loadCmdSettings(config,a) } register_menucmd(register_menuid("Cvars Menu"),1023,"actionCvarMenu") register_clcmd("amx_cvarmenu","cmdCvarMenu",ADMIN_CVAR,"- displays cvars menu") - loadCvarSettings("addons/amxx/configs/cvars.ini") + new cvars_ini_file[64]; + format(cvars_ini_file, 63, "%s/%s", configsDir, "cvars.ini"); + loadCvarSettings(cvars_ini_file) g_cstrikeRunning = is_running("cstrike") } diff --git a/plugins/mapchooser.sma b/plugins/mapchooser.sma index 4eaa791b..c0a5fe77 100755 --- a/plugins/mapchooser.sma +++ b/plugins/mapchooser.sma @@ -63,7 +63,10 @@ public plugin_init() get_localinfo("lastMap",g_lastMap,31) set_localinfo("lastMap","") - if ( loadSettings("addons/amxx/configs/maps.ini") ) + new maps_ini_file[64]; + get_configsdir(maps_ini_file, 63); + format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file); + if ( loadSettings(maps_ini_file) ) set_task(15.0,"voteNextmap",987456,"",0,"b") } diff --git a/plugins/mapsmenu.sma b/plugins/mapsmenu.sma index 3c21f256..a76099cb 100755 --- a/plugins/mapsmenu.sma +++ b/plugins/mapsmenu.sma @@ -62,7 +62,10 @@ public plugin_init() register_menucmd(register_menuid("Votemap Menu"),1023,"actionVoteMapMenu") register_menucmd(register_menuid("The winner: ") ,3,"actionResult") - load_settings("addons/amxx/configs/maps.ini") + new maps_ini_file[64]; + get_configsdir(maps_ini_file, 63); + format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file); + load_settings(maps_ini_file) g_cstrikeRunning = is_running("cstrike") } diff --git a/plugins/pausecfg.sma b/plugins/pausecfg.sma index 9144f180..6e9a8116 100755 --- a/plugins/pausecfg.sma +++ b/plugins/pausecfg.sma @@ -43,7 +43,7 @@ #define MAX_SYSTEM 32 new g_menuPos[33] -new g_fileToSave[] = "addons/amxx/configs/pausecfg.ini" +new g_fileToSave[64]; new g_cstrikeRunning new g_Modified new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^"" @@ -62,6 +62,9 @@ public plugin_init(){ #endif register_menucmd(register_menuid("Pause/Unpause Plugins"),1023,"actionMenu") g_cstrikeRunning = is_running("cstrike") + get_configsdir(g_fileToSave, 63); + format(g_fileToSave, 63, "%s/pausecfg.ini", g_fileToSave); + return PLUGIN_CONTINUE } diff --git a/plugins/plmenu.sma b/plugins/plmenu.sma index d13245bd..7414895b 100755 --- a/plugins/plmenu.sma +++ b/plugins/plmenu.sma @@ -70,7 +70,10 @@ public plugin_init() g_cstrikeRunning = is_running("cstrike") - load_settings("addons/amxx/configs/clcmds.ini") + new clcmds_ini_file[64]; + get_configsdir(clcmds_ini_file, 63); + format(clcmds_ini_file, 63, "%s/clcmds.ini", clcmds_ini_file); + load_settings(clcmds_ini_file) } /* Ban menu */ diff --git a/plugins/restmenu.sma b/plugins/restmenu.sma index a1b72743..9726460e 100755 --- a/plugins/restmenu.sma +++ b/plugins/restmenu.sma @@ -363,12 +363,14 @@ public plugin_init(){ register_menucmd(-34,511,"menuItem") register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction") + new configsDir[64]; + get_configsdir(configsDir, 63); #if defined MAPSETTINGS new mapname[32] get_mapname(mapname,31) - build_path(g_saveFile,63,"addons/amxx/configs/weaprest_%s.ini",mapname) + format(g_saveFile,63,"%s/weaprest_%s.ini",configsDir,mapname) #else - build_path(g_saveFile,63,"addons/amxx/configs/weaprest.ini") + format(g_saveFile,63,"%s/weaprest.ini",configsDir) #endif loadSettings(g_saveFile) } @@ -495,8 +497,12 @@ public cmdRest(id,level,cid){ else if ( equali( "load" , cmd ) ) { setc( g_blockPos, 112, 0 ) // Clear current settings new arg1[64] - if ( read_argv(2, arg1 , 63 ) ) build_path( arg1 , 63, "$basedir/%s", arg1 ) - else copy( arg1, 63, g_saveFile ) + if ( read_argv(2, arg1 , 63 ) ) + { + new configsdir[32] + get_configsdir(configsdir,31) + format(arg1,63,"%s/%s",configsdir,arg1) + } if ( loadSettings( arg1 ) ){ console_print( id , "Configuration has been loaded (file ^"%s^")" , arg1 ) g_Modified = true diff --git a/plugins/statscfg.sma b/plugins/statscfg.sma index 74521d9c..d8d276c2 100755 --- a/plugins/statscfg.sma +++ b/plugins/statscfg.sma @@ -42,7 +42,7 @@ new g_menuDataVar[MAX_MENU_DATA][32] new g_menuDataId[MAX_MENU_DATA] new g_menuDataNum new g_menuPosition[33] -new g_fileToSave[] = "addons/amxx/configs/stats.ini" +new g_fileToSave[64] new bool:g_modified public plugin_precache(){ @@ -53,6 +53,8 @@ public plugin_precache(){ public plugin_init() { register_plugin("Stats Configuration","0.16","AMXX Dev Team") register_menucmd(register_menuid("\yStats Configuration"),1023,"actionCfgMenu") + get_configsdir(g_fileToSave, 63) + format(g_fileToSave, 63, "%s/stats.ini", g_fileToSave) loadSettings(g_fileToSave) } diff --git a/plugins/welcomemsg.sma b/plugins/welcomemsg.sma index d94333ac..220e5adf 100755 --- a/plugins/welcomemsg.sma +++ b/plugins/welcomemsg.sma @@ -45,13 +45,15 @@ new g_cstrikeRunning #if defined READ_FROM_FILE -new g_motdFile[] = "addons/amxx/configs/conmotd.txt" +new g_motdFile[64] #endif public plugin_init() { register_plugin("Welcome Message","0.16","AMXX Dev Team") g_cstrikeRunning = is_running("cstrike") + get_configsdir(g_motdFile, 63); + format(g_motdFile, 63, "%s/conmotd.txt", g_motdFile); } public plugin_cfg() diff --git a/plugins/welcomemsg_cs15.sma b/plugins/welcomemsg_cs15.sma index a168a904..f9a5bf75 100755 --- a/plugins/welcomemsg_cs15.sma +++ b/plugins/welcomemsg_cs15.sma @@ -43,13 +43,15 @@ new g_cstrikeRunning #if defined READ_FROM_FILE -new g_motdFile[] = "addons/amxx/configs/conmotd.txt" +new g_motdFile[64] #endif public plugin_init() { register_plugin("Welcome Message","0.16","AMXX Dev Team") g_cstrikeRunning = is_running("cstrike") + get_configsdir(g_motdFile, 63); + format(g_motdFile, 63, "%s/conmotd.txt", g_motdFile); } new g_Bar[] = "=============="