NU merge Admin Logs.

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
[SLR]
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 27 Dec 2010, 14:21
Detinator Steam: Da
Detinator server CS: Da
Has thanked: 2 times
Contact:

21 Jul 2012, 13:54

Am instalat pe server Admin Logs 1.2 , pe server si nu imi creaza folderul "adminlogs" si nici un logo in configs.
Pluginul ruleaza , am urmat instructiunile l-am pus primu in lista. si tot nu merge.
Link official: https://forums.alliedmods.net/showthread.php?t=108878
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define ACCESS ADMIN_KICK	

//====================================================================
//      Variables
//====================================================================

// Thanks to Xellath
new g_szSpecialChars[ ][ ] =
{
    "/",
    "\",
    ":",
    "*",
    "?",
    ">", 
    "<",
    "|",
    ";"
};



new logfile[200],string[500],configsdir[200]

new cvar_log,cvar_save_direct,cvar_save_name,cvar_zp,cvar_admin,cvar_amxx,cvar_file;

public plugin_init()
{
	register_plugin("AdminLogs", "1.2", "pirvu")
//====================================================================
//      Cvars
//====================================================================

	cvar_log = register_cvar("log_steam","3")
	cvar_save_direct = register_cvar("log_direct","0")
	cvar_save_name=register_cvar("log_name","1")
	cvar_zp=register_cvar("log_zp","1");
	cvar_admin= register_cvar("log_admin","1");
	cvar_amxx=register_cvar("log_amxx","1");
	cvar_file= register_cvar("log_usefile", "1");
	
}

//====================================================================
//     Hook player command
//====================================================================

public client_command(id)
{
	if (get_user_flags(id) & ACCESS) 
	{

		
//====================================================================
//	Read arguments
//====================================================================

		new bigarg[64], arg[7][65];
		read_args(bigarg,charsmax( bigarg ) );
		new iStringSize = charsmax( arg);
		parse(bigarg, 
		arg[0], iStringSize , 
		arg[1], iStringSize ,  
		arg[2], iStringSize ,
		arg[3], iStringSize ,
		arg[4], iStringSize ,
		arg[5], iStringSize ,
		arg[6], iStringSize );

		get_configsdir(configsdir,199)
	
//====================================================================
//      If the command contains amx_
//====================================================================

		if( ( containi(arg[0], "amx_") != -1  && get_pcvar_num(cvar_amxx) ) || ( containi(arg[0], "zp_") != -1  && get_pcvar_num(cvar_zp) ) || ( containi(arg[0], "admin_") != -1  && get_pcvar_num(cvar_admin) ) )
		{



//====================================================================
//	Get player name , steam , ip
//====================================================================
	
			new name[32], ip[32],steam[32];

			get_user_name(id,name,31)

			if (get_pcvar_num(cvar_save_name)) 
			{
				for( new i = 0; i < sizeof( g_szSpecialChars ); i++ )
        				if( contain( name, g_szSpecialChars[ i ] ) )
           					replace_all( name, charsmax( name ), g_szSpecialChars[ i ], "" );
    
	   			trim( name); // remove spaces
				//thanks to Xellath
			}


			get_user_ip(id,ip,31,1)
			get_user_authid(id,steam,31)

			
//====================================================================
//	Get current date & time
//====================================================================

			static s_Time[ 16 ], s_Date[ 16 ];

			get_time ( "%m%d", s_Date, charsmax ( s_Date ) );
   			get_time ( "%H:%M:%S", s_Time, charsmax ( s_Time ) );	

//====================================================================
// 	Make the /adminlogs folder
//====================================================================

			add(configsdir, charsmax(configsdir),"/adminlogs");
			if(!dir_exists(configsdir))	mkdir(configsdir)
			add(configsdir, charsmax(configsdir),"/");

//====================================================================
// 	Make the second folder
//====================================================================

			switch (get_pcvar_num(cvar_save_direct))
			{
		 		case 1: add(configsdir,charsmax(configsdir),ip);
		 		case 2: add(configsdir,charsmax(configsdir),steam)
		 		default : add(configsdir, charsmax(configsdir),s_Date);
			}
	
			if(!dir_exists(configsdir))  mkdir(configsdir)

//====================================================================
// 	Make the log file name
//====================================================================
			
			if (get_pcvar_num(cvar_file))
			{
				
				new iFile = fopen("/addons/amxmodx/configs/users.ini","r");
				new Buffer[256];
				while(!feof(iFile))
				{
					fgets(iFile,Buffer,255);
					
						
					if ( containi (Buffer , ip ) !=-1 )
					{
						formatex(logfile,199,"%s/%s.log",configsdir,ip)	

						switch (get_pcvar_num(cvar_log))
						{
							case 1:  formatex(string,499,"[%s] Ip [%s] used command %s %s %s %s %s %s %s",s_Time,ip,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
							case 2:  formatex(string,499,"[%s] SteamID [%s] used command %s %s %s %s %s %s %s",s_Time,steam,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
							case 3:  formatex(string,499,"[%s] Ip[%s] SteamID [%s] used command %s %s %s %s %s %s %s",s_Time,ip,steam,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6])
							default: formatex(string,499,"[%s] used command %s %s %s %s %s %s %s",s_Time,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);

						}
	
						write_file(logfile,string,-1)
						fclose(iFile);
						return PLUGIN_CONTINUE

					}

					else if ( containi (Buffer , steam ) !=-1 )
					{
						formatex(logfile,199,"%s/%s.log",configsdir,steam)	

						switch (get_pcvar_num(cvar_log))
						{
							case 1:  formatex(string,499,"[%s] Ip [%s] used command %s %s %s %s %s %s %s",s_Time,ip,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
							case 2:  formatex(string,499,"[%s] SteamID [%s] used command %s %s %s %s %s %s %s",s_Time,steam,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
							case 3:  formatex(string,499,"[%s] Ip[%s] SteamID [%s] used command %s %s %s %s %s %s %s",s_Time,ip,steam,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6])
							default: formatex(string,499,"[%s] used command %s %s %s %s %s %s %s",s_Time,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);

						}
	
						write_file(logfile,string,-1)
						fclose(iFile);
						return PLUGIN_CONTINUE

					}

				}


			}
					
			if (get_pcvar_num(cvar_save_name))	formatex(logfile,199,"%s/%s.log",configsdir,name)
			else formatex(logfile,199,"%s/%s.log",configsdir,s_Date)

//====================================================================
//	Log the command 
//====================================================================
	
			switch (get_pcvar_num(cvar_log))
			{
				case 1:  formatex(string,499,"[%s] Ip [%s] used command %s %s %s %s %s %s %s",s_Time,ip,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
				case 2:  formatex(string,499,"[%s] SteamID [%s] used command %s %s %s %s %s %s %s",s_Time,steam,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);
				case 3:  formatex(string,499,"[%s] Ip[%s] SteamID [%s] used command %s %s %s %s %s %s %s",s_Time,ip,steam,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6])
				default: formatex(string,499,"[%s] used command %s %s %s %s %s %s %s",s_Time,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]);

			}
	
			write_file(logfile,string,-1)


		}
	}
	return PLUGIN_CONTINUE
}
Daca puteti sa`i dati de cap , va rog frumos, ca am nevoie de el.
Aen
User avatar
Andrei.B
Fost administrator
Fost administrator
Posts: 6481
Joined: 17 Aug 2009, 08:15
Detinator Steam: Da
CS Status: Plecat pe mari si tari
Detinator server CS: Nu detin !
SteamID: andreybci94
Reputatie: Fost Membru Club eXtreamCS (o luna)
Fost Administrator
Nume anterior : bLack, Andrei,krusc
Contribuitor
Location: ConstanTa
Has thanked: 275 times
Been thanked: 556 times
Contact:

24 Jul 2012, 17:13

Ai setat cvar-urile ?

Mereu in suflet culorile ( Roş -Albastru )
Image
ImageImage
[SLR]
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 27 Dec 2010, 14:21
Detinator Steam: Da
Detinator server CS: Da
Has thanked: 2 times
Contact:

25 Jul 2012, 16:38

Cvaruri | Afiseaza codul
//Pluginul Admin Logs
log_steam 3
log_direct 0
log_name 1
log_amxx 1
log_admin 1
log_zp 0
log_usefile 1
Astea le am acuma ,am incercat si cu ele altfel si tot nu a mers.
NisQ20
Membru, skill +1
Membru, skill +1
Posts: 124
Joined: 12 Aug 2012, 01:58
Detinator Steam: Da
CS Status: VIBE.LALEAGANE.RO
Detinator server CS: Da
Been thanked: 4 times
Contact:

12 Aug 2012, 22:01

Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests