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

player


Post New Thread Reply   
 
Thread Tools Display Modes
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-04-2019 , 13:47   Re: log show player join n leave
Reply With Quote #11

Quote:
Originally Posted by ^SmileY View Post
change MAX_NAME_LENGTH constant to 32
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-04-2019 , 14:15   Re: log show player join n leave
Reply With Quote #12

[MAX_NAME_LENGTH] should be [32]

lol

PHP Code:
#include <amxmodx>

new g_szLogName[32];

public 
plugin_cfg()
{
    
register_plugin("Join / Leave Log",AMXX_VERSION_STR,"SmileY");
    
    
formatex(g_szLogName,charsmax(g_szLogName),"Players_%i.log",get_systime());
}

public 
client_connectex(id,const szName[],const szIP[],szReason[128])
{
    new 
szAuth[MAX_AUTHID_LENGTH];
    
get_user_authid(id,szAuth,charsmax(szAuth));
    
    
log_to_file(g_szLogName,"[%s [%s] %s] Connected!",szName,szIP,szAuth);
}

public 
client_disconnected(id,bool:bDrop,szMsg[])
{
    new 
szName[32];
    
get_user_name(id,szName,charsmax(szName));
    
    new 
szIP[23];
    
get_user_ip(id,szIP,charsmax(szIP));
    
    new 
szAuth[35];
    
get_user_authid(id,szAuth,charsmax(szAuth));
    
    
log_to_file(g_szLogName,"[%s %s %s] (%s) Disconnected!",szName,szIP,szAuth,szMsg);

Anyway is here, but plugin won't compile on 1.8.2, because client_connectex and client_disconnected forward.
Soo here is a version for Amxx 1.8.2

PHP Code:
#include <amxmodx>

new g_szLogName[32];

public 
plugin_cfg()
{
    
register_plugin("Join / Leave Log",AMXX_VERSION_STR,"SmileY");
    
    
formatex(g_szLogName,charsmax(g_szLogName),"Players_%i.log",get_systime());
}

public 
client_connect(id)
{
    new 
szName[32];
    
get_user_name(id,szName,charsmax(szName));
    
    new 
szIP[23];
    
get_user_ip(id,szIP,charsmax(szIP));
    
    new 
szAuth[35];
    
get_user_authid(id,szAuth,charsmax(szAuth));
    
    
log_to_file(g_szLogName,"[%s %s %s] Connected!",szName,szIP,szAuth);


public 
client_disconnect(id)
{
    new 
szName[32];
    
get_user_name(id,szName,charsmax(szName));
    
    new 
szIP[23];
    
get_user_ip(id,szIP,charsmax(szIP));
    
    new 
szAuth[35];
    
get_user_authid(id,szAuth,charsmax(szAuth));
    
    
log_to_file(g_szLogName,"[%s %s %s] Disconnected!",szName,szIP,szAuth);

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 12-04-2019 at 14:20.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Old 12-05-2019, 14:30
veliflst
This message has been deleted by veliflst.
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-05-2019 , 14:44   Re: log show player join n leave
Reply With Quote #13

So your server changed 34 times in a day, nice traffic lol

I edited my post, try it
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Old 12-05-2019, 15:24
veliflst
This message has been deleted by veliflst.
Old 01-02-2020, 07:06
veliflst
This message has been deleted by veliflst.
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-02-2020 , 12:08   Re: log show player join n leave
Reply With Quote #14

PHP Code:
#include <amxmodx>

new g_szLogName[32];

public 
plugin_cfg()
{
    
register_plugin("Join / Leave Log",AMXX_VERSION_STR,"SmileY");
    
    
formatex(g_szLogName,charsmax(g_szLogName),"Players_%i.log",get_systime());
}

public 
client_connect(id)
{
    if(!
is_user_bot(id))
    {
        new 
szName[32];
        
get_user_name(id,szName,charsmax(szName));
        
        new 
szIP[23];
        
get_user_ip(id,szIP,charsmax(szIP));
                    
        new 
szAuth[35];
        
get_user_authid(id,szAuth,charsmax(szAuth));
                    
        
log_to_file(g_szLogName,"[%s %s %s] Connected!",szName,szIP,szAuth);
    }


public 
client_disconnect(id)
{
    if(!
is_user_bot(id))
    {
        new 
szName[32];
        
get_user_name(id,szName,charsmax(szName));
        
        new 
szIP[23];
        
get_user_ip(id,szIP,charsmax(szIP));
        
        new 
szAuth[35];
        
get_user_authid(id,szAuth,charsmax(szAuth));
        
        
log_to_file(g_szLogName,"[%s %s %s] Disconnected!",szName,szIP,szAuth);
    }

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-02-2020 , 12:29   Re: log show player join n leave
Reply With Quote #15

If you have the command log on is set you can get the logs from cstrike/logs/.... Including players activity.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Old 01-03-2020, 21:11
veliflst
This message has been deleted by veliflst.
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 16:35.


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