Raised This Month: $ Target: $400
 0% 

Log in the file server players


Post New Thread Reply   
 
Thread Tools Display Modes
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-28-2008 , 09:19   Re: Log on the file server players
Reply With Quote #11

i didnt changed anything in it, just did code readable
__________________
xPaw is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 11-28-2008 , 09:37   Re: Log on the file server players
Reply With Quote #12

Thanks xPaw,
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-03-2008 , 16:06   Re: Log on the file server players
Reply With Quote #13

You should give the actual file name on the first post so players don't have to look for what it would be.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 12-07-2008 , 19:29   Re: Log on the file server players
Reply With Quote #14

Quote:
Originally Posted by connorr View Post
You could use static vars in disconnect && putinserver.

Are you sure you can (always) retrieve steamid in client_disconnect forward ? You could use global vars so you don't have to retrieve steamid and ip again (won't have been changed) when player disconnect.
can you show the sample codes?
Mlk27 is offline
Old 12-20-2008, 11:45
Starsailor
This message has been deleted by YamiKaitou. Reason: single word post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-20-2008 , 12:00   Re: Log on the file server players
Reply With Quote #15

Sure.
Also i've put shptools way to log in a file that seems to be a lot faster than log_to_file native.

PHP Code:
#include <amxmodx>

#define PLUGIN    "Log on the file server players"
#define VERSION    "1.0"
#define AUTHOR    "Starsailor"

#define MAX_PLAYERS    32

#define MAX_STEAMID_LENGTH    20
#define MAX_IP_LENGTH    15 // with port -> //21

new g_szAuthid[MAX_PLAYERS+1][MAX_STEAMID_LENGTH+1]
new 
g_szIp[MAX_PLAYERS+1][MAX_IP_LENGTH+1]

new 
g_Enabled;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    new 
szMapName[32];
    
get_mapname(szMapNamecharsmax(szMapName));
    
    
g_Enabled register_cvar("ltf_enable""1")
    
    if( 
get_pcvar_num(g_Enabled) )
        
UTIL_Log_To_File("------------ Map %s : ------------"szMapName);
}

public 
client_putinserverid )
{
    if( 
get_pcvar_num(g_Enabled) ) {
        static 
szName[32]
        
        
get_user_name(idszNamecharsmax(szName));
        
get_user_ip(idg_szIp[id], MAX_IP_LENGTH1);
        
get_user_authid(idg_szAuthid[id], MAX_STEAMID_LENGTH);
        
        
UTIL_Log_To_File("Player %s connected (%s) (IP: %s)"szNameg_szAuthidg_szIp); 
    }
}    

public 
client_disconnect(id){
    if( 
get_pcvar_num(g_Enabled) ) {
        static 
szName[32]
        
        
get_user_name(idszNamecharsmax(szName));
        
        
UTIL_Log_To_File("Player %s disconnected (%s) (IP: %s)"szNameg_szAuthidg_szIp);
    }
}

UTIL_Log_To_File(const fmt[], any:...) // from shptools
{
    static 
string[512]
    
vformat(stringcharsmax(string), fmt2)

    static 
date[16], time[16], fp
    get_time
("%H:%M:%S"time15)

    static 
logfile[192]
    if(
logfile[0] == 0)
    {
        new 
basedir[64]
        
get_localinfo("amxx_basedir",basedir,63)
        
get_time("%m%d"date15)
        
formatex(logfile127"%s/logs/players_server_%s.log"basedirdate)
    }

    
get_time("%m/%d/%Y"date15)
    
fp fopen(logfile"a")
    
fprintf(fp"L %s - %s: %s^n"datetimestring)
    
fclose(fp)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Vm|Mayhem
Senior Member
Join Date: Feb 2005
Location: Murrieta, CA.
Old 12-20-2008 , 12:25   Re: Log on the file server players
Reply With Quote #16

Thanks, simple but usefull.
__________________
Vm|Mayhem is offline
Send a message via AIM to Vm|Mayhem
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 01-22-2009 , 12:18   Re: Log on the file server players
Reply With Quote #17

Quote:
Originally Posted by Exolent[jNr] View Post
You should give the actual file name on the first post so players don't have to look for what it would be.

Done
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-05-2009 , 22:15   Re: Log on the file server players
Reply With Quote #18

There are a few mistakes and optimizations that can be made, however it is acceptable.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
funstyle
Member
Join Date: Feb 2010
Location: RO, Bucharest
Old 02-26-2010 , 07:26   Re: Log in the file server players
Reply With Quote #19

can you write a blank row? like this



edit later: i solved the problem
Attached Thumbnails
Click image for larger version

Name:	untitled.JPG
Views:	264
Size:	35.7 KB
ID:	60530  

Last edited by funstyle; 02-28-2010 at 18:33.
funstyle is offline
Send a message via Yahoo to funstyle
rollingdice
New Member
Join Date: Oct 2011
Old 10-31-2011 , 08:12   Re: Log in the file server players
Reply With Quote #20

I've been working diligently to filter out bots for this log file but I'm unable to figure it out after many desperate attempts. This is one of the many combinations i've came up with... but i believe it's the closest.

A couple notes:
*The bots I use are set to not have BOT or skill level in their name - they are PBots
*This is direct copy of one line of a bot being logged that i would like to remove the line/event entirely as u see the authid has BOT in it: "L 10/31/2011 - 07:02:42: Player Phil Theo Johnson connected (BOT) (IP: 127.0.0.1)"
*I have attempted pursing filtering out by local ip (127.0.0.1) as well but no luck
*I think other users of this script would enjoy not seeing their player log file not flooded with bots as well... just a reflection.

Code:
public client_putinserver( id )
{
	if( get_pcvar_num(g_Enabled) )
	{
		new name[32], authid[32], userip[32];
		
		get_user_name(id, name, 31);
		get_user_ip(id, userip, 31, 1);
		get_user_authid(id, authid, 31);
		
		if ( authid = "BOT")
		{
			 //Don't print the freaking bots
		}
		else
		{
			log_to_file(LOGFILE, "Player %s connected (%s) (IP: %s)",name,authid,userip); 
		}
	}
}
All help is very appreciated

Last edited by rollingdice; 10-31-2011 at 08:19.
rollingdice is offline
Old 03-05-2012, 21:52
isotonic
This message has been deleted by isotonic.
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode