moved cvars to this plugin | sets ADMIN_ADMIN

This commit is contained in:
Felix Geyer 2004-03-07 00:55:22 +00:00
parent b0e83a9116
commit 2c897e5e87
2 changed files with 34 additions and 10 deletions

View File

@ -52,6 +52,13 @@ public plugin_init()
register_cvar("amx_password_field","_pw")
register_cvar("amx_default_access","")
register_cvar("amx_vote_ratio","0.02")
register_cvar("amx_vote_time","10")
register_cvar("amx_vote_answers","1")
register_cvar("amx_vote_delay","60")
register_cvar("amx_last_voting","0")
set_cvar_float("amx_last_voting",0.0)
#if !defined NO_STEAM
format( g_cmdLoopback, 15, "amxauth%c%c%c%c" ,
random_num('A','Z') , random_num('A','Z') ,random_num('A','Z'),random_num('A','Z') )
@ -82,6 +89,9 @@ loadSettings(szFilename[])
if ( parse(szText, g_aName[ g_aNum ] ,31,
g_aPassword[ g_aNum ], 31, szAccess,31,szFlags,31 ) < 2 ) continue
if ( (containi(szAccess,"z")==-1) && (containi(szAccess,"y")==-1) )
szAccess[strlen(szAccess)] = 'y'
g_aAccess[ g_aNum ] = read_flags( szAccess )
g_aFlags[ g_aNum ] = read_flags( szFlags )
++g_aNum
@ -133,7 +143,7 @@ getAccess(id,name[],authid[],ip[], password[])
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
set_user_flags(id,g_aAccess[index])
log_amx("Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
else if (equal(password,g_aPassword[index])) {
@ -141,7 +151,7 @@ getAccess(id,name[],authid[],ip[], password[])
set_user_flags(id,g_aAccess[index])
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
log_amx("Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
else {

View File

@ -58,6 +58,16 @@ public plugin_init()
register_cvar("amx_mysql_pass","")
register_cvar("amx_mysql_db","amx")
register_cvar("amx_vote_ratio","0.02")
register_cvar("amx_votekick_ratio","0.40")
register_cvar("amx_voteban_ratio","0.40")
register_cvar("amx_votemap_ratio","0.40")
register_cvar("amx_vote_time","10")
register_cvar("amx_vote_answers","1")
register_cvar("amx_vote_delay","60")
register_cvar("amx_last_voting","0")
set_cvar_float("amx_last_voting",0.0)
#if !defined NO_STEAM
format( g_cmdLoopback, 15, "amxauth%c%c%c%c" ,
random_num('A','Z') , random_num('A','Z') ,random_num('A','Z'),random_num('A','Z') )
@ -69,7 +79,7 @@ public plugin_init()
new filename[32]
get_basedir( filename , 31 )
server_cmd("exec %s/amx.cfg" , filename)
server_cmd("exec %s/mysql.cfg;amx_sqladmins" , filename)
server_cmd("exec %s/configs/mysql.cfg;amx_sqladmins" , filename)
}
public adminSql(){
@ -93,7 +103,7 @@ public adminSql(){
return PLUGIN_HANDLED
}
new szFlags[32], szAccess[32]
new szFlags[32],szAccess[32]
g_aNum = 0 /* reset admins settings */
while( mysql_nextrow(mysql) > 0 )
{
@ -101,6 +111,10 @@ public adminSql(){
mysql_getfield(mysql, 2, g_aPassword[ g_aNum ] ,31)
mysql_getfield(mysql, 3, szAccess,31)
mysql_getfield(mysql, 4, szFlags,31)
if ( (containi(szAccess,"z")==-1) && (containi(szAccess,"y")==-1) )
szAccess[strlen(szAccess)] = 'y'
g_aAccess[ g_aNum ] = read_flags( szAccess )
g_aFlags[ g_aNum ] = read_flags( szFlags )
++g_aNum
@ -153,7 +167,7 @@ getAccess(id,name[],authid[],ip[], password[]){
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
set_user_flags(id,g_aAccess[index])
log_amx("Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
else if (equal(password,g_aPassword[index])) {
@ -161,7 +175,7 @@ getAccess(id,name[],authid[],ip[], password[]){
set_user_flags(id,g_aAccess[index])
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
log_amx("Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
else {