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

saved name and ip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 08-22-2020 , 21:02   saved name and ip
Reply With Quote #1

Hi, I'm looking for a plugin that saves the name and IP of all players in a txt.
El Abuelo Loco is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-23-2020 , 01:02   Re: saved name and ip
Reply With Quote #2

PHP Code:

#include <amxmodx>
#include <amxmisc>

new const Version[] = "0.1";

public 
plugin_init() 
{
    
register_plugin"Players Store" Version "bugsy" );
}

public 
client_authorizedid )
{
    if ( !
is_user_botid ) )
    {
        new 
szDataDir64 ] , szTime32 ] , szLine128 ] , szName33 ] , szIP16 ] , szAuthID34 ];
        
        
get_user_nameid szName charsmaxszName ) );
        
get_user_ipid szIP charsmaxszIP ) , );
        
get_user_authidid szAuthID charsmaxszAuthID ) );
        
format_timeszTime charsmaxszTime ) , "%m/%d/%Y %H:%M:%S" );
        
formatexszLine charsmaxszLine ) , "Time=[%s] Name=[%s] IP=[%s] SteamID=[%s]" szTime szName szIP szAuthID );
        
        
formatexszDataDirget_datadirszDataDir charsmaxszDataDir ) ) ] , charsmaxszDataDir ) , "/Players.txt" );
        
        
write_fileszDataDir szLine );
    }

__________________
Bugsy is offline
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 08-23-2020 , 14:06   Re: saved name and ip
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
PHP Code:

#include <amxmodx>
#include <amxmisc>

new const Version[] = "0.1";

public 
plugin_init() 
{
    
register_plugin"Players Store" Version "bugsy" );
}

public 
client_authorizedid )
{
    if ( !
is_user_botid ) )
    {
        new 
szDataDir64 ] , szTime32 ] , szLine128 ] , szName33 ] , szIP16 ] , szAuthID34 ];
        
        
get_user_nameid szName charsmaxszName ) );
        
get_user_ipid szIP charsmaxszIP ) , );
        
get_user_authidid szAuthID charsmaxszAuthID ) );
        
format_timeszTime charsmaxszTime ) , "%m/%d/%Y %H:%M:%S" );
        
formatexszLine charsmaxszLine ) , "Time=[%s] Name=[%s] IP=[%s] SteamID=[%s]" szTime szName szIP szAuthID );
        
        
formatexszDataDirget_datadirszDataDir charsmaxszDataDir ) ) ] , charsmaxszDataDir ) , "/Players.txt" );
        
        
write_fileszDataDir szLine );
    }

It does not work, so it does not add the names or the IP at all in the txt.
El Abuelo Loco is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-23-2020 , 14:10   Re: saved name and ip
Reply With Quote #4

Just tested it

Players.txt
Code:
Time=[08/23/2020 01:01:51] Name=[bugsy] IP=[192.168.1.212] SteamID=[STEAM_0:0:111111]
__________________
Bugsy is offline
El Abuelo Loco
Senior Member
Join Date: Jun 2020
Old 08-23-2020 , 18:00   Re: saved name and ip
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Just tested it

Players.txt
Code:
Time=[08/23/2020 01:01:51] Name=[bugsy] IP=[192.168.1.212] SteamID=[STEAM_0:0:111111]
just in case the Players.txt is created by itself or do I have to add it myself?
El Abuelo Loco is offline
Stefanos
Senior Member
Join Date: May 2020
Old 08-23-2020 , 18:10   Re: saved name and ip
Reply With Quote #6

it will create by itself, great plugin idea, and again ty bugsy...
Stefanos is offline
Reply


Thread Tools
Display Modes

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 04:34.


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