Raised This Month: $51 Target: $400
 12% 

Log in the file server players


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management        Approver:   Hawk552 (427)
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 11-27-2008 , 19:18   Log in the file server players
Reply With Quote #1

Log on the file server players

DESCRIPTION
This plugin Log in a file, players who connect to the server, showing IP, AuthID, date and time of client connect/disconnect.

file .log is located in the default folder ---> \addons\amxmodx\logs

CVAR

ltf_enable 0/1 Enable/Disable the plugin


I hope you enjoy my plugin

Thanks to xPaw.. He has made my code readable


Attached Files
File Type: sma Get Plugin or Get Source (log-to-file.sma - 2770 views - 1.0 KB)
__________________
Find my plugins here..

Ex - Spanish Moderator.

Last edited by Starsailor; 02-11-2009 at 09:55.
Starsailor is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 11-27-2008 , 19:24   Re: Log on the file server players
Reply With Quote #2

Am I mistaken or does hlds have the capability of doing that in the moddir logs?

log on
mp_logdetail 1

I could be wrong, just wondering why, if it does.
__________________
bmann_420 is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 11-27-2008 , 19:30   Re: Log on the file server players
Reply With Quote #3

I do not know if he does, but I check all the logs and none said the player connected, the ip or authID



__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-27-2008 , 19:47   Re: Log on the file server players
Reply With Quote #4

I believe mp_logdetail only deals with attacking

Anyways, use pcvars and fix up your indentation (looks like crap).
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-28-2008 , 00:42   Re: Log on the file server players
Reply With Quote #5

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 #6

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 #8

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
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 11-28-2008 , 02:29   Re: Log on the file server players
Reply With Quote #9

Code:
L 11/08/2008 - 15:59:00: "arOxa#gAm!nG[FLex][LeADeR]<1316><STEAM_0:1:XXXXXXX><>" connected, address "XXX.XXX.XXX.XXX:27005"
L 11/08/2008 - 15:59:02: "arOxa#gAm!nG[FLex][LeADeR]<1316><STEAM_0:1:XXXXXXX><>" STEAM USERID validated
It allways did this, just changed the order a bit with new protokoll 48.
And yes, mp_logdetails is for dammage events only
__________________


Last edited by Mordekay; 11-28-2008 at 02:35. Reason: nah, the numbers are wrong....
Mordekay is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 11-28-2008 , 07:18   Re: Log on the file server players
Reply With Quote #10

ready, and I already changed pcvars. no more loose indentation
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
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 05:51.


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