mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
plugins using localinfo paths now
This commit is contained in:
parent
63e1d7e43b
commit
a3c9489360
@ -72,7 +72,11 @@ public plugin_init()
|
|||||||
|
|
||||||
remove_user_flags(0,read_flags("z")) // Remove 'user' flag from server rights
|
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
|
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))
|
if (!cmd_access(id,level,cid,1))
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
|
|
||||||
new filename[64]
|
new filename[128]
|
||||||
get_basedir(filename,31)
|
get_configsdir(filename,127)
|
||||||
format(filename,63,"%s/configs/users.ini",filename)
|
format(filename,63,"%s/users.ini", filename)
|
||||||
|
|
||||||
g_aNum = 0
|
g_aNum = 0
|
||||||
loadSettings(filename) // Re-Load admins accounts
|
loadSettings(filename) // Re-Load admins accounts
|
||||||
|
@ -81,8 +81,10 @@ public plugin_init()
|
|||||||
|
|
||||||
remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights
|
remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights
|
||||||
|
|
||||||
server_cmd("exec addons/amxx/amxx.cfg")
|
new configsDir[128]
|
||||||
server_cmd("exec addons/amxx/configs/mysql.cfg;amx_sqladmins")
|
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() {
|
public adminSql() {
|
||||||
|
@ -90,18 +90,22 @@ public plugin_init()
|
|||||||
{
|
{
|
||||||
register_plugin("Commands Menu","0.16","AMXX Dev Team")
|
register_plugin("Commands Menu","0.16","AMXX Dev Team")
|
||||||
|
|
||||||
|
new configsDir[64];
|
||||||
|
get_configsdir(configsDir, 63);
|
||||||
new config[64]
|
new config[64]
|
||||||
for(new a = 0; a < MAX_CMDS_LAYERS; ++a) {
|
for(new a = 0; a < MAX_CMDS_LAYERS; ++a) {
|
||||||
register_menucmd(register_menuid( g_cmdMenuName[ a ] ),1023,"actionCmdMenu")
|
register_menucmd(register_menuid( g_cmdMenuName[ a ] ),1023,"actionCmdMenu")
|
||||||
register_clcmd( g_cmdMenuCmd[ a ] ,"cmdCmdMenu",ADMIN_MENU, g_cmdMenuHelp[ a ] )
|
register_clcmd( g_cmdMenuCmd[ a ] ,"cmdCmdMenu",ADMIN_MENU, g_cmdMenuHelp[ a ] )
|
||||||
format(config,63,"addons/amxx/configs/%s",g_cmdMenuCfg[a])
|
format(config,63,"%s/%s",configsDir,g_cmdMenuCfg[a])
|
||||||
loadCmdSettings(config,a)
|
loadCmdSettings(config,a)
|
||||||
}
|
}
|
||||||
|
|
||||||
register_menucmd(register_menuid("Cvars Menu"),1023,"actionCvarMenu")
|
register_menucmd(register_menuid("Cvars Menu"),1023,"actionCvarMenu")
|
||||||
register_clcmd("amx_cvarmenu","cmdCvarMenu",ADMIN_CVAR,"- displays cvars menu")
|
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")
|
g_cstrikeRunning = is_running("cstrike")
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,10 @@ public plugin_init()
|
|||||||
get_localinfo("lastMap",g_lastMap,31)
|
get_localinfo("lastMap",g_lastMap,31)
|
||||||
set_localinfo("lastMap","")
|
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")
|
set_task(15.0,"voteNextmap",987456,"",0,"b")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,10 @@ public plugin_init()
|
|||||||
register_menucmd(register_menuid("Votemap Menu"),1023,"actionVoteMapMenu")
|
register_menucmd(register_menuid("Votemap Menu"),1023,"actionVoteMapMenu")
|
||||||
register_menucmd(register_menuid("The winner: ") ,3,"actionResult")
|
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")
|
g_cstrikeRunning = is_running("cstrike")
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#define MAX_SYSTEM 32
|
#define MAX_SYSTEM 32
|
||||||
|
|
||||||
new g_menuPos[33]
|
new g_menuPos[33]
|
||||||
new g_fileToSave[] = "addons/amxx/configs/pausecfg.ini"
|
new g_fileToSave[64];
|
||||||
new g_cstrikeRunning
|
new g_cstrikeRunning
|
||||||
new g_Modified
|
new g_Modified
|
||||||
new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^""
|
new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^""
|
||||||
@ -62,6 +62,9 @@ public plugin_init(){
|
|||||||
#endif
|
#endif
|
||||||
register_menucmd(register_menuid("Pause/Unpause Plugins"),1023,"actionMenu")
|
register_menucmd(register_menuid("Pause/Unpause Plugins"),1023,"actionMenu")
|
||||||
g_cstrikeRunning = is_running("cstrike")
|
g_cstrikeRunning = is_running("cstrike")
|
||||||
|
get_configsdir(g_fileToSave, 63);
|
||||||
|
format(g_fileToSave, 63, "%s/pausecfg.ini", g_fileToSave);
|
||||||
|
|
||||||
return PLUGIN_CONTINUE
|
return PLUGIN_CONTINUE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,10 @@ public plugin_init()
|
|||||||
|
|
||||||
g_cstrikeRunning = is_running("cstrike")
|
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 */
|
/* Ban menu */
|
||||||
|
@ -363,12 +363,14 @@ public plugin_init(){
|
|||||||
register_menucmd(-34,511,"menuItem")
|
register_menucmd(-34,511,"menuItem")
|
||||||
register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction")
|
register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction")
|
||||||
|
|
||||||
|
new configsDir[64];
|
||||||
|
get_configsdir(configsDir, 63);
|
||||||
#if defined MAPSETTINGS
|
#if defined MAPSETTINGS
|
||||||
new mapname[32]
|
new mapname[32]
|
||||||
get_mapname(mapname,31)
|
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
|
#else
|
||||||
build_path(g_saveFile,63,"addons/amxx/configs/weaprest.ini")
|
format(g_saveFile,63,"%s/weaprest.ini",configsDir)
|
||||||
#endif
|
#endif
|
||||||
loadSettings(g_saveFile)
|
loadSettings(g_saveFile)
|
||||||
}
|
}
|
||||||
@ -495,8 +497,12 @@ public cmdRest(id,level,cid){
|
|||||||
else if ( equali( "load" , cmd ) ) {
|
else if ( equali( "load" , cmd ) ) {
|
||||||
setc( g_blockPos, 112, 0 ) // Clear current settings
|
setc( g_blockPos, 112, 0 ) // Clear current settings
|
||||||
new arg1[64]
|
new arg1[64]
|
||||||
if ( read_argv(2, arg1 , 63 ) ) build_path( arg1 , 63, "$basedir/%s", arg1 )
|
if ( read_argv(2, arg1 , 63 ) )
|
||||||
else copy( arg1, 63, g_saveFile )
|
{
|
||||||
|
new configsdir[32]
|
||||||
|
get_configsdir(configsdir,31)
|
||||||
|
format(arg1,63,"%s/%s",configsdir,arg1)
|
||||||
|
}
|
||||||
if ( loadSettings( arg1 ) ){
|
if ( loadSettings( arg1 ) ){
|
||||||
console_print( id , "Configuration has been loaded (file ^"%s^")" , arg1 )
|
console_print( id , "Configuration has been loaded (file ^"%s^")" , arg1 )
|
||||||
g_Modified = true
|
g_Modified = true
|
||||||
|
@ -42,7 +42,7 @@ new g_menuDataVar[MAX_MENU_DATA][32]
|
|||||||
new g_menuDataId[MAX_MENU_DATA]
|
new g_menuDataId[MAX_MENU_DATA]
|
||||||
new g_menuDataNum
|
new g_menuDataNum
|
||||||
new g_menuPosition[33]
|
new g_menuPosition[33]
|
||||||
new g_fileToSave[] = "addons/amxx/configs/stats.ini"
|
new g_fileToSave[64]
|
||||||
new bool:g_modified
|
new bool:g_modified
|
||||||
|
|
||||||
public plugin_precache(){
|
public plugin_precache(){
|
||||||
@ -53,6 +53,8 @@ public plugin_precache(){
|
|||||||
public plugin_init() {
|
public plugin_init() {
|
||||||
register_plugin("Stats Configuration","0.16","AMXX Dev Team")
|
register_plugin("Stats Configuration","0.16","AMXX Dev Team")
|
||||||
register_menucmd(register_menuid("\yStats Configuration"),1023,"actionCfgMenu")
|
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)
|
loadSettings(g_fileToSave)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,13 +45,15 @@
|
|||||||
new g_cstrikeRunning
|
new g_cstrikeRunning
|
||||||
|
|
||||||
#if defined READ_FROM_FILE
|
#if defined READ_FROM_FILE
|
||||||
new g_motdFile[] = "addons/amxx/configs/conmotd.txt"
|
new g_motdFile[64]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public plugin_init()
|
public plugin_init()
|
||||||
{
|
{
|
||||||
register_plugin("Welcome Message","0.16","AMXX Dev Team")
|
register_plugin("Welcome Message","0.16","AMXX Dev Team")
|
||||||
g_cstrikeRunning = is_running("cstrike")
|
g_cstrikeRunning = is_running("cstrike")
|
||||||
|
get_configsdir(g_motdFile, 63);
|
||||||
|
format(g_motdFile, 63, "%s/conmotd.txt", g_motdFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public plugin_cfg()
|
public plugin_cfg()
|
||||||
|
@ -43,13 +43,15 @@
|
|||||||
new g_cstrikeRunning
|
new g_cstrikeRunning
|
||||||
|
|
||||||
#if defined READ_FROM_FILE
|
#if defined READ_FROM_FILE
|
||||||
new g_motdFile[] = "addons/amxx/configs/conmotd.txt"
|
new g_motdFile[64]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public plugin_init()
|
public plugin_init()
|
||||||
{
|
{
|
||||||
register_plugin("Welcome Message","0.16","AMXX Dev Team")
|
register_plugin("Welcome Message","0.16","AMXX Dev Team")
|
||||||
g_cstrikeRunning = is_running("cstrike")
|
g_cstrikeRunning = is_running("cstrike")
|
||||||
|
get_configsdir(g_motdFile, 63);
|
||||||
|
format(g_motdFile, 63, "%s/conmotd.txt", g_motdFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
new g_Bar[] = "=============="
|
new g_Bar[] = "=============="
|
||||||
|
Loading…
Reference in New Issue
Block a user