From 0bdc09d3d991c0d3b4226da80afd7028b4044dc8 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Tue, 9 Mar 2004 15:53:40 +0000 Subject: [PATCH] hardcoded pathes --- plugins/admin.sma | 7 ++----- plugins/admin_mysql.sma | 6 ++---- plugins/cmdmenu.sma | 16 +++++++--------- plugins/include/amxmisc.inc | 6 ++---- plugins/mapchooser.sma | 4 +--- plugins/mapsmenu.sma | 6 ++---- plugins/pausecfg.sma | 3 +-- plugins/plmenu.sma | 4 +--- plugins/restmenu.sma | 4 ++-- plugins/statscfg.sma | 3 +-- plugins/welcomemsg.sma | 7 ++----- plugins/welcomemsg_cs15.sma | 7 ++----- 12 files changed, 25 insertions(+), 48 deletions(-) diff --git a/plugins/admin.sma b/plugins/admin.sma index 31feb53f..925287bc 100755 --- a/plugins/admin.sma +++ b/plugins/admin.sma @@ -71,11 +71,8 @@ public plugin_init() remove_user_flags(0,read_flags("z")) // Remove 'user' flag from server rights - new filename[64] - get_basedir( filename , 31 ) - server_cmd("exec %s/amx.cfg" , filename ) // Execute main configuration file - format( filename, 63 , "%s/configs/users.ini" , filename ) - loadSettings( filename ) // Load admins accounts + server_cmd("exec addons/amxx/amx.cfg") // Execute main configuration file + loadSettings("addons/amxx/configs/users.ini") // Load admins accounts } loadSettings(szFilename[]) diff --git a/plugins/admin_mysql.sma b/plugins/admin_mysql.sma index eaaa35a7..8f2c4ea1 100755 --- a/plugins/admin_mysql.sma +++ b/plugins/admin_mysql.sma @@ -80,10 +80,8 @@ public plugin_init() remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights - new filename[32] - get_basedir( filename , 31 ) - server_cmd("exec %s/amx.cfg" , filename) - server_cmd("exec %s/configs/mysql.cfg;amx_sqladmins" , filename) + server_cmd("exec addons/amxx/amx.cfg") + server_cmd("exec addons/amxx/configs/mysql.cfg;amx_sqladmins") } public adminSql() { diff --git a/plugins/cmdmenu.sma b/plugins/cmdmenu.sma index af862392..a5a9c9ca 100755 --- a/plugins/cmdmenu.sma +++ b/plugins/cmdmenu.sma @@ -90,21 +90,19 @@ public plugin_init() { register_plugin("Commands Menu","0.1","AMXX Dev Team") - new basedir[32], workdir[64] - get_basedir( basedir , 31 ) + 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( workdir, 63, "%s/configs/%s" , basedir , g_cmdMenuCfg[ a ] ) - loadCmdSettings( workdir , a ) + format(config,63,"addons/amxx/configs/%s",g_cmdMenuCfg[a]) + loadCmdSettings(config,a) } - + register_menucmd(register_menuid("Cvars Menu"),1023,"actionCvarMenu") register_clcmd("amx_cvarmenu","cmdCvarMenu",ADMIN_CVAR,"- displays cvars menu") - - format( workdir, 63, "%s/configs/cvars.ini" , basedir ) - loadCvarSettings( workdir ) - + + loadCvarSettings("addons/amxx/configs/cvars.ini") + g_cstrikeRunning = is_running("cstrike") } diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index 075a0ffd..788a8faa 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -92,11 +92,9 @@ stock is_running(const arg[]) { } stock build_path( path[] , len , {Float,_}:... ) { - new basedir[32] - get_localinfo( "amxx_basedir", basedir , 31 ) format_args( path , len , 2 ) - return replace( path , len , "$basedir", basedir ) + return replace( path , len , "$basedir", "addons/amxx" ) } stock get_basedir( name[], len ) - return get_localinfo( "amxx_basedir", name , len ) \ No newline at end of file + return copy(name,len,"addons/amxx") \ No newline at end of file diff --git a/plugins/mapchooser.sma b/plugins/mapchooser.sma index 5eda7175..5c025c1e 100755 --- a/plugins/mapchooser.sma +++ b/plugins/mapchooser.sma @@ -63,9 +63,7 @@ public plugin_init() get_localinfo("lastMap",g_lastMap,31) set_localinfo("lastMap","") - new filename[64] - build_path( filename , 63 , "$basedir/configs/maps.ini" ) - if ( loadSettings( filename ) ) + if ( loadSettings("addons/amxx/configs/maps.ini") ) set_task(15.0,"voteNextmap",987456,"",0,"b") } diff --git a/plugins/mapsmenu.sma b/plugins/mapsmenu.sma index 6fb881d0..5471e7aa 100755 --- a/plugins/mapsmenu.sma +++ b/plugins/mapsmenu.sma @@ -63,10 +63,8 @@ public plugin_init() register_menucmd(register_menuid("Change map to"),527,"voteCount") register_menucmd(register_menuid("Votemap Menu"),1023,"actionVoteMapMenu") register_menucmd(register_menuid("The winner: ") ,3,"actionResult") - - new filename[64] - build_path( filename , 63 , "$basedir/configs/maps.ini" ) - load_settings( filename ) + + load_settings("addons/amxx/configs/maps.ini") g_cstrikeRunning = is_running("cstrike") } diff --git a/plugins/pausecfg.sma b/plugins/pausecfg.sma index 095bd5e5..98d2dbbd 100755 --- a/plugins/pausecfg.sma +++ b/plugins/pausecfg.sma @@ -43,7 +43,7 @@ #define MAX_SYSTEM 32 new g_menuPos[33] -new g_fileToSave[64] +new g_fileToSave[] = "addons/amxx/configs/pausecfg.ini" new g_cstrikeRunning new g_Modified new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^"" @@ -82,7 +82,6 @@ public cmdON(id,level,cid){ #endif public plugin_cfg() { - build_path( g_fileToSave , 63 , "$basedir/configs/pausecfg.ini" ) loadSettings(g_fileToSave) // Put here titles of plugins which you don't want to pause server_cmd(g_addCmd , "Pause Plugins" ) diff --git a/plugins/plmenu.sma b/plugins/plmenu.sma index 6988fc53..563efa14 100755 --- a/plugins/plmenu.sma +++ b/plugins/plmenu.sma @@ -70,9 +70,7 @@ public plugin_init() g_cstrikeRunning = is_running("cstrike") - new filename[64] - build_path( filename , 63 , "$basedir/configs/clcmds.ini" ) - load_settings( filename ) + load_settings("addons/amxx/configs/clcmds.ini") } /* Ban menu */ diff --git a/plugins/restmenu.sma b/plugins/restmenu.sma index 1b4970ac..7ec7090f 100755 --- a/plugins/restmenu.sma +++ b/plugins/restmenu.sma @@ -366,9 +366,9 @@ public plugin_init(){ #if defined MAPSETTINGS new mapname[32] get_mapname(mapname,31) - build_path( g_saveFile , 63 , "$basedir/configs/weaprest_%s.ini" ,mapname ) + build_path(g_saveFile,63,"addons/amxx/configs/weaprest_%s.ini",mapname) #else - build_path( g_saveFile , 63 , "$basedir/configs/weaprest.ini" ) + build_path(g_saveFile,63,"addons/amxx/configs/weaprest.ini") #endif loadSettings(g_saveFile) } diff --git a/plugins/statscfg.sma b/plugins/statscfg.sma index c4bfee62..14c45838 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[64] +new g_fileToSave[] = "addons/amxx/configs/stats.ini" new bool:g_modified public plugin_precache(){ @@ -53,7 +53,6 @@ public plugin_precache(){ public plugin_init() { register_plugin("Stats Configuration","0.1","AMXX Dev Team") register_menucmd(register_menuid("\yStats Configuration"),1023,"actionCfgMenu") - build_path( g_fileToSave , 63 , "$basedir/configs/stats.ini" ) loadSettings(g_fileToSave) } diff --git a/plugins/welcomemsg.sma b/plugins/welcomemsg.sma index 025a5a4b..7bbd68a4 100755 --- a/plugins/welcomemsg.sma +++ b/plugins/welcomemsg.sma @@ -45,16 +45,13 @@ new g_cstrikeRunning #if defined READ_FROM_FILE -new g_motdFile[64] +new g_motdFile[] = "addons/amxx/configs/conmotd.txt" #endif public plugin_init() { register_plugin("Welcome Message","0.1","AMXX Dev Team") g_cstrikeRunning = is_running("cstrike") -#if defined READ_FROM_FILE - build_path( g_motdFile , 63 , "$basedir/configs/conmotd.txt" ) -#endif } public plugin_cfg() @@ -118,7 +115,7 @@ public alt_motd(param[]) { new mod_ver[32] len += copy(motdBody[len],MOTD_LENGTH-len,"
Server mods: