switched to log_amx() | changed configs dir

This commit is contained in:
Felix Geyer 2004-03-04 20:16:45 +00:00
parent e52a377370
commit c3616b67b1
14 changed files with 81 additions and 101 deletions

View File

@ -42,7 +42,6 @@ new g_aName[MAX_ADMINS][32]
new g_aFlags[MAX_ADMINS]
new g_aAccess[MAX_ADMINS]
new g_aNum
new g_logFile[16]
#if !defined NO_STEAM
new g_cmdLoopback[16]
#endif
@ -54,8 +53,6 @@ public plugin_init()
register_cvar("amx_password_field","_pw")
register_cvar("amx_default_access","")
get_logfile(g_logFile,15)
#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') )
@ -68,7 +65,7 @@ public plugin_init()
new filename[64]
get_basedir( filename , 31 )
server_cmd("exec %s/amx.cfg" , filename ) // Execute main configuration file
format( filename, 63 , "%s/users.ini" , filename )
format( filename, 63 , "%s/configs/users.ini" , filename )
loadSettings( filename ) // Load admins accounts
}
@ -137,7 +134,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_to_file(g_logFile,"Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" become 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])) {
@ -145,14 +142,14 @@ getAccess(id,name[],authid[],ip[], password[])
set_user_flags(id,g_aAccess[index])
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
log_to_file(g_logFile,"Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
else {
result |= 1
if (g_aFlags[index] & FLAG_KICK){
result |= 2
log_to_file(g_logFile,"Login: ^"%s<%d><%s><>^" kicked due to invalid password (account ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" kicked due to invalid password (account ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index],ip)
}
}

View File

@ -43,7 +43,6 @@ new g_aName[MAX_ADMINS][32]
new g_aFlags[MAX_ADMINS]
new g_aAccess[MAX_ADMINS]
new g_aNum
new g_logFile[16]
#if !defined NO_STEAM
new g_cmdLoopback[16]
#endif
@ -67,11 +66,8 @@ public plugin_init()
register_clcmd( g_cmdLoopback, "ackSignal" )
#endif
remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights
get_logfile(g_logFile,15)
new filename[32]
get_basedir( filename , 31 )
server_cmd("exec %s/amx.cfg" , filename)
@ -159,7 +155,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_to_file(g_logFile,"Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" become 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])) {
@ -167,14 +163,14 @@ getAccess(id,name[],authid[],ip[], password[]){
set_user_flags(id,g_aAccess[index])
new sflags[32]
get_flags(g_aAccess[index],sflags,31)
log_to_file(g_logFile,"Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" become an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
}
else {
result |= 1
if (g_aFlags[index] & FLAG_KICK){
result |= 2
log_to_file(g_logFile,"Login: ^"%s<%d><%s><>^" kicked due to invalid password (account ^"%s^") (address ^"%s^")",
log_amx("Login: ^"%s<%d><%s><>^" kicked due to invalid password (account ^"%s^") (address ^"%s^")",
name,get_user_userid(id),authid,g_aName[index],ip)
}
}

View File

@ -39,7 +39,6 @@
// names with hud messages
//#define SHOW_NAMES
new g_logFile[16]
new g_msgChannel
#define MAX_CLR 7
@ -56,7 +55,6 @@ public plugin_init(){
register_concmd("amx_psay","cmdPsay",ADMIN_CHAT,"<name or #userid> <message> - sends private message")
register_concmd("amx_tsay","cmdTsay",ADMIN_CHAT,"<color> <message> - sends left side hud message to all players")
register_concmd("amx_csay","cmdTsay",ADMIN_CHAT,"<color> <message> - sends center hud message to all players")
get_logfile(g_logFile,15)
}
public cmdSayChat(id) {
@ -81,7 +79,7 @@ public cmdSayChat(id) {
get_user_authid(id,authid,31)
get_user_name(id,name,31)
userid = get_user_userid(id)
log_to_file(g_logFile,"Chat: ^"%s<%d><%s><>^" tsay ^"%s^"",name,userid,authid,message[i+1])
log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"",name,userid,authid,message[i+1])
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%s^")",
name,userid,authid,message[ i+1 ],g_Colors[a])
if (++g_msgChannel>6||g_msgChannel<3)
@ -112,7 +110,7 @@ public cmdSayAdmin(id) {
get_user_authid(id,authid,31)
get_user_name(id,name,31)
userid = get_user_userid(id)
log_to_file(g_logFile,"Chat: ^"%s<%d><%s><>^" chat ^"%s^"",name,userid,authid,message[1])
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"",name,userid,authid,message[1])
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")",name,userid,authid,message[1])
format(message,191,"(ADMINS) %s : %s",name,message[1])
get_players(players,inum)
@ -134,7 +132,7 @@ public cmdChat(id,level,cid){
get_user_name(id,name,31)
userid = get_user_userid(id)
get_players(players,inum)
log_to_file(g_logFile,"Chat: ^"%s<%d><%s><>^" chat ^"%s^"",name,userid,authid,message)
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"",name,userid,authid,message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")",name,userid,authid,message)
format(message,191,"(ADMINS) %s : %s",name,message)
console_print(id,message)
@ -156,7 +154,7 @@ public cmdSay(id,level,cid){
userid = get_user_userid(id)
client_print(0,print_chat,"(ALL) %s : %s",name,message)
console_print(id,"(ALL) %s : %s",name,message)
log_to_file(g_logFile,"Chat: ^"%s<%d><%s><>^" say ^"%s^"", name,userid,authid,message)
log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name,userid,authid,message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")",name,userid,authid,message)
return PLUGIN_HANDLED
}
@ -186,7 +184,7 @@ public cmdPsay(id,level,cid){
console_print(id,"(%s) %s : %s",name,name2,message[length])
get_user_authid(priv,authid2,31)
userid2 = get_user_userid(priv)
log_to_file(g_logFile,"Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"",
log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"",
name2,userid,authid,name,userid2,authid2,message[length])
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")",
name2,userid,authid,name,userid2,authid2,message[length])
@ -228,7 +226,7 @@ public cmdTsay(id,level,cid){
console_print(id,message[length])
#endif
log_to_file(g_logFile,"Chat: ^"%s<%d><%s><>^" %s ^"%s^"",name,userid,authid,cmd[4],message[length])
log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"",name,userid,authid,cmd[4],message[length])
log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")",
name,userid,authid,cmd,message[length],g_Colors[a])
return PLUGIN_HANDLED

View File

@ -33,12 +33,12 @@
*/
#include <amxmod>
#include <engine>
#include <amxmisc>
#define MAXRCONCVARS 16
new g_cvarRcon[ MAXRCONCVARS ][32]
new g_cvarRconNum
new g_logFile[16]
new g_pauseCon
new Float:g_pausAble
new bool:g_Paused
@ -67,7 +67,6 @@ public plugin_init(){
register_cvar("amx_vote_answers","")
register_cvar("amx_vote_ratio","")
register_cvar("amx_show_activity","")
get_logfile(g_logFile,15)
}
public plugin_cfg(){
@ -97,7 +96,7 @@ public cmdKick(id,level,cid){
userid2 = get_user_userid(player)
read_argv(2,reason,31)
remove_quotes(reason)
log_to_file(g_logFile,"Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^" (reason ^"%s^")",
log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^" (reason ^"%s^")",
name,get_user_userid(id),authid,name2,userid2,authid2,reason)
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: kick %s",name,name2)
@ -127,7 +126,7 @@ public cmdUnban(id,level,cid){
case 1: client_print(0,print_chat,"ADMIN: unban %s",arg)
}
get_user_authid(id,authid,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" unban ^"%s^"",
log_amx("Cmd: ^"%s<%d><%s><>^" unban ^"%s^"",
name,get_user_userid(id),authid, arg )
return PLUGIN_HANDLED
}
@ -153,7 +152,7 @@ public cmdAddBan(id,level,cid){
case 1: client_print(0,print_chat,"ADMIN: ban %s",arg)
}
get_user_authid(id,authid,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" ban ^"%s^" (minutes ^"%s^") (reason ^"%s^")",
log_amx("Cmd: ^"%s<%d><%s><>^" ban ^"%s^" (minutes ^"%s^") (reason ^"%s^")",
name,get_user_userid(id),authid, arg, minutes, reason )
return PLUGIN_HANDLED
}
@ -175,7 +174,7 @@ public cmdBan(id,level,cid){
get_user_name(id,name,31)
userid2 = get_user_userid(player)
read_argv(3,reason,31)
log_to_file(g_logFile,"Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")",
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")",
name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason)
new temp[64]
@ -219,7 +218,7 @@ public cmdSlay(id,level,cid){
get_user_name(id,name,31)
get_user_authid(player,authid2,31)
get_user_name(player,name2,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"",
log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"",
name,get_user_userid(id),authid, name2,get_user_userid(player),authid2 )
switch(get_cvar_num("amx_show_activity")) {
@ -246,7 +245,7 @@ public cmdSlap(id,level,cid){
get_user_name(id,name,31)
get_user_authid(player,authid2,31)
get_user_name(player,name2,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"",
log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"",
name,get_user_userid(id),authid, damage,name2,get_user_userid(player),authid2 )
switch(get_cvar_num("amx_show_activity")) {
@ -277,8 +276,10 @@ public cmdMap(id,level,cid){
case 2: client_print(0,print_chat,"ADMIN %s: changelevel %s",name,arg)
case 1: client_print(0,print_chat,"ADMIN: changelevel %s",arg)
}
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"", name,get_user_userid(id),authid, arg)
set_task(1.0,"chMap",0,arg,arglen+1)
log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"", name,get_user_userid(id),authid, arg)
message_begin(MSG_ALL, SVC_INTERMISSION)
message_end()
set_task(2.0,"chMap",0,arg,arglen+1)
return PLUGIN_HANDLED
}
@ -324,7 +325,7 @@ public cmdCvar(id,level,cid){
new authid[32],name[32]
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" set cvar (name ^"%s^") (value ^"%s^")",
log_amx("Cmd: ^"%s<%d><%s><>^" set cvar (name ^"%s^") (value ^"%s^")",
name,get_user_userid(id),authid, arg,arg2)
set_cvar_string(arg,arg2)
@ -354,7 +355,7 @@ public cmdCfg(id,level,cid){
new authid[32],name[32]
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" execute cfg (file ^"%s^")",
log_amx("Cmd: ^"%s<%d><%s><>^" execute cfg (file ^"%s^")",
name,get_user_userid(id),authid, arg)
console_print(id,"Executing file ^"%s^"",arg)
server_cmd("exec %s",arg)
@ -389,7 +390,7 @@ public cmdPause(id,level,cid){
}
set_cvar_float("pausable",1.0)
client_cmd(slayer,"pause;pauseAck")
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" %s server",
log_amx("Cmd: ^"%s<%d><%s><>^" %s server",
name,get_user_userid(id),authid, g_Paused ? "unpause" : "pause" )
console_print(id,"Server proceed %s", g_Paused ? "unpausing" : "pausing")
@ -409,7 +410,7 @@ public cmdRcon(id,level,cid){
read_args(arg,127)
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")",
log_amx("Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")",
name,get_user_userid(id),authid, arg)
console_print(id,"Commmand line ^"%s^" sent to server console",arg)
server_cmd(arg)
@ -437,7 +438,7 @@ public cmdWho(id,level,cid){
console_print(id,"Total %d",inum)
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" ask for players list",name,get_user_userid(id),authid)
log_amx("Cmd: ^"%s<%d><%s><>^" ask for players list",name,get_user_userid(id),authid)
return PLUGIN_HANDLED
}
@ -484,7 +485,7 @@ public cmdLeave(id,level,cid){
new authid[32],name[32]
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Kick: ^"%s<%d><%s><>^" leave some group (tag1 ^"%s^") (tag2 ^"%s^") (tag3 ^"%s^") (tag4 ^"%s^")",
log_amx("Kick: ^"%s<%d><%s><>^" leave some group (tag1 ^"%s^") (tag2 ^"%s^") (tag3 ^"%s^") (tag4 ^"%s^")",
name,get_user_userid(id),authid,ltags[0],ltags[1],ltags[2],ltags[3] )
switch(get_cvar_num("amx_show_activity")) {

View File

@ -40,7 +40,6 @@ new g_optionName[4][32]
new g_voteCount[4]
new g_validMaps
new g_yesNoVote
new g_logFile[16]
new g_cstrikeRunning
new g_voteCaller
new g_Execute[256]
@ -78,7 +77,6 @@ public plugin_init() {
set_cvar_float("amx_last_voting",0.0)
register_cvar("amx_show_activity","2")
g_cstrikeRunning = is_running("cstrike")
get_logfile(g_logFile,15)
}
public cmdCancelVote(id,level,cid){
@ -88,7 +86,7 @@ public cmdCancelVote(id,level,cid){
new authid[32],name[32]
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Vote: ^"%s<%d><%s><>^" cancel vote session", name,get_user_userid(id),authid)
log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name,get_user_userid(id),authid)
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"%s %s: cancel vote", (get_user_flags(id) & ADMIN_USER) ? g_playerTag : g_adminTag, name)
case 1: client_print(0,print_chat,"%s: cancel vote", (get_user_flags(id) & ADMIN_USER) ? g_playerTag : g_adminTag)
@ -112,7 +110,7 @@ new g_votingFailed[] = "Voting failed"
new g_votingSuccess[] = "Voting successful"
public autoRefuse(){
log_to_file(g_logFile,"Vote: %s" , g_resultRef)
log_amx("Vote: %s" , g_resultRef)
client_print(0,print_chat,g_resultRef )
}
@ -121,7 +119,7 @@ public actionResult(id,key) {
switch(key){
case 0: {
set_task(2.0,"delayedExec",0,g_Execute,g_execLen)
log_to_file(g_logFile,"Vote: %s",g_resultAcpt)
log_amx("Vote: %s",g_resultAcpt)
client_print(0,print_chat,g_resultAcpt )
}
case 1: autoRefuse()
@ -144,7 +142,7 @@ public checkVotes() {
client_print(0,print_chat,"%s (yes ^"%d^") (no ^"%d^") (needed ^"%d^")",g_votingFailed, g_voteCount[0], g_voteCount[1] , iRatio )
else
client_print(0,print_chat,"%s (got ^"%d^") (needed ^"%d^")",g_votingFailed,iResult , iRatio )
log_to_file(g_logFile,"Vote: %s (got ^"%d^") (needed ^"%d^")",g_votingFailed,iResult , iRatio )
log_amx("Vote: %s (got ^"%d^") (needed ^"%d^")",g_votingFailed,iResult , iRatio )
return PLUGIN_CONTINUE
}
g_execLen = format(g_Execute,255,g_Answer,g_optionName[best]) + 1
@ -162,7 +160,7 @@ public checkVotes() {
set_task(2.0,"delayedExec",0,g_Execute,g_execLen)
}
client_print(0,print_chat,"%s (got ^"%d^") (needed ^"%d^"). The result: %s", g_votingSuccess, iResult , iRatio , g_Execute )
log_to_file(g_logFile,"Vote: %s (got ^"%d^") (needed ^"%d^") (result ^"%s^")", g_votingSuccess, iResult , iRatio , g_Execute )
log_amx("Vote: %s (got ^"%d^") (needed ^"%d^") (result ^"%s^")", g_votingSuccess, iResult , iRatio , g_Execute )
return PLUGIN_CONTINUE
}
@ -231,10 +229,10 @@ public cmdVoteMap(id,level,cid) {
get_user_authid(id,authid,31)
get_user_name(id,name,31)
if (argc==2)
log_to_file(g_logFile,"Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")",
log_amx("Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")",
name,get_user_userid(id),authid,g_optionName[0])
else
log_to_file(g_logFile,"Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")",
log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")",
name,get_user_userid(id),authid,g_optionName[0],g_optionName[1],g_optionName[2],g_optionName[3])
switch(get_cvar_num("amx_show_activity")) {
@ -282,7 +280,7 @@ public cmdVote(id,level,cid) {
new authid[32],name[32]
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")",
log_amx("Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")",
name,get_user_userid(id),authid,quest,g_optionName[0],g_optionName[1])
switch(get_cvar_num("amx_show_activity")) {
@ -349,7 +347,7 @@ public cmdVoteKickBan(id,level,cid) {
new authid[32],name[32]
get_user_authid(id,authid,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")",
log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")",
name,get_user_userid(id),authid,voteban ? "ban" : "kick",arg)
switch(get_cvar_num("amx_show_activity")) {

View File

@ -95,14 +95,14 @@ public plugin_init()
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/%s" , basedir , g_cmdMenuCfg[ a ] )
format( workdir, 63, "%s/configs/%s" , basedir , g_cmdMenuCfg[ a ] )
loadCmdSettings( workdir , a )
}
register_menucmd(register_menuid("Cvars Menu"),1023,"actionCvarMenu")
register_clcmd("amx_cvarmenu","cmdCvarMenu",ADMIN_CVAR,"- displays cvars menu")
format( workdir, 63, "%s/cvars.ini" , basedir )
format( workdir, 63, "%s/configs/cvars.ini" , basedir )
loadCvarSettings( workdir )
g_cstrikeRunning = is_running("cstrike")

View File

@ -49,7 +49,6 @@ new g_lastMap[32]
new g_cstrikeRunning
new bool:g_selected = false
new g_logFile[16]
public plugin_init()
{
@ -63,10 +62,9 @@ public plugin_init()
get_localinfo("lastMap",g_lastMap,31)
set_localinfo("lastMap","")
get_logfile(g_logFile,15)
new filename[64]
build_path( filename , 63 , "$basedir/maps.ini" )
build_path( filename , 63 , "$basedir/configs/maps.ini" )
if ( loadSettings( filename ) )
set_task(15.0,"voteNextmap",987456,"",0,"b")
}
@ -82,7 +80,7 @@ public checkVotes(){
new Float:steptime = get_cvar_float("amx_extendmap_step")
set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + steptime )
client_print(0,print_chat,"Choosing finished. Current map will be extended to next %.0f minutes", steptime )
log_to_file(g_logFile,"Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes",
log_amx("Vote: Voting for the nextmap finished. Map %s will be extended to next %.0f minutes",
mapname , steptime )
return
}
@ -91,7 +89,7 @@ public checkVotes(){
new smap[32]
get_cvar_string("amx_nextmap",smap,31)
client_print(0,print_chat,"Choosing finished. The nextmap will be %s", smap )
log_to_file(g_logFile,"Vote: Voting for the nextmap finished. The nextmap will be %s", smap)
log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap)
}
public countVote(id,key){
@ -168,7 +166,7 @@ public voteNextmap(){
set_task(15.0,"checkVotes")
client_print(0,print_chat,"It's time to choose the nextmap...")
client_cmd(0,"spk Gman/Gman_Choose2")
log_to_file(g_logFile,"Vote: Voting for the nextmap started")
log_amx("Vote: Voting for the nextmap started")
}
loadSettings(filename[])

View File

@ -34,6 +34,7 @@
#include <amxmod>
#include <engine>
#include <amxmisc>
#define MAX_MAPS 64
@ -42,7 +43,6 @@ new g_mapName[MAX_MAPS][32]
new g_mapDesc[MAX_MAPS][32]
new g_mapNums
new g_menuPosition[33]
new g_logFile[16]
new g_voteCount[5]
@ -66,11 +66,9 @@ public plugin_init()
register_menucmd(register_menuid("The winner: ") ,3,"actionResult")
new filename[64]
build_path( filename , 63 , "$basedir/maps.ini" )
build_path( filename , 63 , "$basedir/configs/maps.ini" )
load_settings( filename )
get_logfile(g_logFile,15)
g_cstrikeRunning = is_running("cstrike")
}
@ -78,7 +76,7 @@ new g_resultAck[] = "Result accepted"
new g_resultRef[] = "Result refused"
public autoRefuse(){
log_to_file(g_logFile,"Vote: %s" , g_resultRef)
log_amx("Vote: %s" , g_resultRef)
client_print(0,print_chat, g_resultRef )
}
@ -89,7 +87,7 @@ public actionResult(id,key) {
message_begin(MSG_ALL, SVC_INTERMISSION)
message_end()
set_task(2.0,"delayedChange",0, g_mapName[ g_choosed ] , strlen(g_mapName[ g_choosed ]) + 1 )
log_to_file(g_logFile,"Vote: %s" , g_resultAck )
log_amx("Vote: %s" , g_resultAck )
client_print(0,print_chat, g_resultAck)
}
case 1: autoRefuse()
@ -113,7 +111,7 @@ public checkVotes( id )
if ( 100 * g_voteCount[a] / num > 50 ) {
g_choosed = g_voteSelected[id][a]
client_print(0,print_chat, "%s %s" , g_voteSuccess , g_mapName[ g_choosed ] )
log_to_file(g_logFile,"Vote: %s %s" , g_voteSuccess , g_mapName[ g_choosed ] )
log_amx("Vote: %s %s" , g_voteSuccess , g_mapName[ g_choosed ] )
}
if ( g_choosed != -1 ) {
if ( is_user_connected( id ) ) {
@ -132,7 +130,7 @@ public checkVotes( id )
}
else {
client_print(0,print_chat, g_VoteFailed )
log_to_file(g_logFile,"Vote: %s" , g_VoteFailed)
log_amx("Vote: %s" , g_VoteFailed)
}
remove_task(34567 + id)
}
@ -143,7 +141,7 @@ public voteCount(id,key)
client_print(0,print_chat,"Voting has been canceled")
remove_task(34567 + id)
set_cvar_float( "amx_last_voting" , get_gametime() )
log_to_file(g_logFile,"Vote: Cancel vote session")
log_amx("Vote: Cancel vote session")
return PLUGIN_HANDLED
}
if (get_cvar_float("amx_vote_answers")) {
@ -345,7 +343,7 @@ public actionVoteMapMenu(id,key)
case 1: client_print(0,print_chat,"ADMIN: vote map(s)")
}
log_to_file(g_logFile,"Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")",
log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")",
name,get_user_userid(id),authid,
g_voteSelectedNum[id] > 0 ? g_mapName[ g_voteSelected[id][ 0 ] ] : "" ,
g_voteSelectedNum[id] > 1 ? g_mapName[ g_voteSelected[id][ 1 ] ] : "" ,
@ -386,7 +384,7 @@ public actionMapsMenu(id,key)
case 1: client_print(0,print_chat,"ADMIN: changelevel %s",g_mapName[ a ])
}
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"",
log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"",
name,get_user_userid(id),authid, g_mapName[ a ] )
set_task(2.0,"delayedChange",0, g_mapName[ a ] , strlen(g_mapName[ a ]) + 1 )

View File

@ -124,11 +124,11 @@ public plugin_init()
{
register_plugin("Menus Front-End","0.1","AMXX Dev Team")
register_menucmd(register_menuid("AMX Mod Menu"),1023,"actionMenu")
register_menucmd(register_menuid("AMX Mod X Menu"),1023,"actionMenu")
register_clcmd("amxmodmenu","cmdMenu",ADMIN_MENU,"- displays menus")
g_cstrikeRunning = is_running("cstrike")
g_funModule = cvar_exists( "fun_version" )
g_funModule = is_module_loaded("Fun")
}
public actionMenu(id,key)
@ -153,7 +153,7 @@ displayMenu(id,pos){
start = pos = g_menuPosition[id] = 0
new len = format(menuBody,511,
g_cstrikeRunning ? "\yAMX Mod Menu\R%d/%d^n\w^n" : "AMX Mod Menu %d/%d^n^n" , pos+1, 2 )
g_cstrikeRunning ? "\yAMX Mod X Menu\R%d/%d^n\w^n" : "AMX Mod X Menu %d/%d^n^n" , pos+1, 2 )
new end = start + 8
new keys = (1<<9)

View File

@ -82,7 +82,7 @@ public cmdON(id,level,cid){
#endif
public plugin_cfg() {
build_path( g_fileToSave , 63 , "$basedir/pausecfg.ini" )
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" )

View File

@ -51,8 +51,6 @@ new g_clcmdCmd[MAX_CLCMDS][64]
new g_clcmdMisc[MAX_CLCMDS][2]
new g_clcmdNum
new g_logFile[16]
new g_cstrikeRunning
public plugin_init()
@ -73,10 +71,8 @@ public plugin_init()
g_cstrikeRunning = is_running("cstrike")
new filename[64]
build_path( filename , 63 , "$basedir/clcmds.ini" )
build_path( filename , 63 , "$basedir/configs/clcmds.ini" )
load_settings( filename )
get_logfile(g_logFile,15)
}
/* Ban menu */
@ -108,7 +104,7 @@ public actionBanMenu(id,key)
get_user_name(id,name,31)
new userid2 = get_user_userid(player)
log_to_file(g_logFile,"Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")",
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")",
name,get_user_userid(id),authid, name2,userid2,authid2, g_menuSettings[id] )
switch(get_cvar_num("amx_show_activity")) {
@ -242,7 +238,7 @@ public actionSlapMenu(id,key)
get_user_name(id,name,31)
if ( g_menuOption[id] ) {
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"",
log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"",
name,get_user_userid(id),authid, g_menuSettings[id], name2,get_user_userid(player),authid2 )
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: slap %s with %d damage",name,name2,g_menuSettings[id])
@ -250,7 +246,7 @@ public actionSlapMenu(id,key)
}
}
else {
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"",
log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"",
name,get_user_userid(id),authid, name2,get_user_userid(player),authid2 )
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: slay %s",name,name2)
@ -363,7 +359,7 @@ public actionKickMenu(id,key)
get_user_name(player,name2,31)
new userid2 = get_user_userid(player)
log_to_file(g_logFile,"Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^"",
log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^"",
name,get_user_userid(id),authid, name2,userid2,authid2 )
switch(get_cvar_num("amx_show_activity")) {
@ -464,7 +460,7 @@ public actionTeamMenu(id,key)
get_user_authid(player,authid2,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")",
log_amx("Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")",
name,get_user_userid(id),authid, name2,get_user_userid(player),authid2, g_menuOption[id] ? "TERRORIST" : "CT" )
switch(get_cvar_num("amx_show_activity")) {

View File

@ -366,9 +366,9 @@ public plugin_init(){
#if defined MAPSETTINGS
new mapname[32]
get_mapname(mapname,31)
build_path( g_saveFile , 63 , "$basedir/weaprest_%s.ini" ,mapname )
build_path( g_saveFile , 63 , "$basedir/configs/weaprest_%s.ini" ,mapname )
#else
build_path( g_saveFile , 63 , "$basedir/weaprest.ini" )
build_path( g_saveFile , 63 , "$basedir/configs/weaprest.ini" )
#endif
loadSettings(g_saveFile)
}

View File

@ -53,7 +53,7 @@ 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/stats.ini" )
build_path( g_fileToSave , 63 , "$basedir/configs/stats.ini" )
loadSettings(g_fileToSave)
}

View File

@ -40,7 +40,6 @@ new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33] = { -1 , ... }
new g_menuOrgin[33][3]
new g_logFile[16]
new g_cstrikeRunning
public plugin_init()
@ -48,7 +47,6 @@ public plugin_init()
register_plugin("Teleport Menu","0.1","AMXX Dev Team")
register_clcmd("amx_teleportmenu","cmdTelMenu",ADMIN_CFG,"- displays teleport menu")
register_menucmd(register_menuid("Teleport Menu"),1023,"actionTelMenu")
get_logfile(g_logFile,15)
g_cstrikeRunning = is_running("cstrike")
}
@ -98,7 +96,7 @@ public actionTelMenu(id,key)
get_user_authid(player,authid2,31)
get_user_name(id,name,31)
log_to_file(g_logFile,"Cmd: ^"%s<%d><%s><>^" teleport ^"%s<%d><%s><>^"",
log_amx("Cmd: ^"%s<%d><%s><>^" teleport ^"%s<%d><%s><>^"",
name,get_user_userid(id),authid, name2,get_user_userid(player),authid2 )
switch(get_cvar_num("amx_show_activity")) {