This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Retry (Check by IP)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 06-03-2015 , 08:04   Retry (Check by IP)
Reply With Quote #1

Hello, i want to write in a file Player IP when is put in server (client_putinserver) before to check in client_connect if player was recorded and if it was then do something

Someone can help me? pls
__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-03-2015 , 08:33   Re: Retry (Check by IP)
Reply With Quote #2

Easy to do with nvault.

https://forums.alliedmods.net/showthread.php?t=91503
__________________
Bugsy is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 06-03-2015 , 09:22   Re: Retry (Check by IP)
Reply With Quote #3

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "0.Ox"
#define AUTHOR "Hades Ownage"

new SaveDataFile 128 ];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    new 
DataDir 64 ];
    
get_datadir DataDir63 );
    
format SaveDataFile127"%s/log_ips.dat"DataDir );
}

public 
client_disconnect id SaveData id );
public 
client_putinserver id LoadData id ); // or client_authorized

public SaveData id ) {
    
    new 
UserIp 40 ]; 
    
get_user_ip idUserIpcharsmax UserIp ) , );
    
    new 
Save 1024 ];
    
format Savesizeof Save ) - 1"^"%s^""UserIp );

    new 
FileOpen fopen SaveDataFile"rt" );
    
    while ( !
feof FileOpen ) )
        
write_file SaveDataFileSave );

    
fclose FileOpen )
}

public 
LoadData id ) {
    
    new 
UserIp 40 ]; 
    
get_user_ip idUserIpcharsmax UserIp ) , );
    
    new 
Line 128 ], Arg1 32 ];
    new 
FileOpen fopen SaveDataFile"rt" );

    while ( !
feof FileOpen ) ) {
        
        
fgets FileOpenLine127 );
        
trim Line );
        
        
parse LineArg1 );
        
        if ( 
equali Arg1UserIp ) ) {
            
            
// do something
            
break;
        }
    }
    
    
fclose FileOpen );
    

try it.
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
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 12:32.


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