Raised This Month: $ Target: $400
 0% 

Record IP and ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
adolescent77
New Member
Join Date: Jun 2006
Old 09-09-2006 , 13:08   Record IP and ID
Reply With Quote #1

Is it possibile to record player's IP and ID into a txt file??
Because I want to put players who cheat in my server into punish mode,
ThankS!!
adolescent77 is offline
umarsa
Senior Member
Join Date: Feb 2006
Location: U.K
Old 09-09-2006 , 13:52   Re: Record IP and ID
Reply With Quote #2

Try That :

Code:
#include <amxmodx>

public plugin_init() {
	register_plugin("Player Disconnect Info." , "0.2" , "v3x");
}

new g_szAuthID[33][33];
new g_szIP[33][44];

public client_authorized(id) {
	get_user_authid(id , g_szAuthID[id] , 32);
	get_user_ip(id , g_szIP[id] , 43);
}

public client_disconnect(id) {
	new szUserName[33];
	get_user_name(id , szUserName , 32);
	
	new aPlayers[32] , iNum , i , gaben;
	get_players(aPlayers , iNum , "c");

	for(i = 1; i <= iNum; i++) {
		gaben = aPlayers[i];
		console_print(gaben , "] %s" , szUserName);
		console_print(gaben , "IP: %s" , g_szIP[id]);
		console_print(gaben , "Steam ID: %s" , g_szAuthID[id]);
		
		
	}

	g_szAuthID[id][0] = 0;
	g_szIP[id][0] = 0;
}
umarsa is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 09-09-2006 , 13:54   Re: Record IP and ID
Reply With Quote #3

Next time try to do what he asks.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
umarsa
Senior Member
Join Date: Feb 2006
Location: U.K
Old 09-09-2006 , 13:54   Re: Record IP and ID
Reply With Quote #4

Well thats what he wanted
umarsa is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 09-09-2006 , 13:55   Re: Record IP and ID
Reply With Quote #5

Quote:
Originally Posted by adolescent77 View Post
Is it possibile to record player's IP and ID into a txt file??
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
umarsa
Senior Member
Join Date: Feb 2006
Location: U.K
Old 09-09-2006 , 13:55   Re: Record IP and ID
Reply With Quote #6

When it prints int server console it logs it into logs/ folder
umarsa is offline
F34RInc
BANNED
Join Date: Dec 2005
Location: Medellín, Colombia
Old 09-17-2006 , 03:50   Re: Record IP and ID
Reply With Quote #7

I use this this it logs their steamid, IP and name to a log file automatically.
F34RInc is offline
Send a message via AIM to F34RInc Send a message via MSN to F34RInc
Old 09-17-2006, 09:40
[ --<-@ ] Black Rose
This message has been deleted by [ --<-@ ] Black Rose.
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 09-17-2006 , 09:41   Re: Record IP and ID
Reply With Quote #8

something like...
Code:
#include <amxmodx> #include <amxmisc> new Auth[33][33] new IP[33][32] new const g_filename[] = "your_info_list.txt" public plugin_init()     register_plugin("..." , "..." , "...") public client_authorized(id) {     get_user_authid(id, Auth[id], 32)     get_user_ip(id, IP[id], 32, 1) } public client_disconnect(id) {         new file[256], cfgdir[128]     get_configsdir(cfgdir, 127)         formatex(file, 256, "%s/%s", cfgdir, g_filename)         new Name[32]     get_user_name(id , Name , 31)         if ( found_in_file(file, Auth[id], Name) )         return PLUGIN_CONTINUE         new text[512]     formatex(text, 511, "^"%s^"  Auth: ^"%s^"  IP: ^"%s^"", Name, Auth[id], IP[id])         write_file(file, text)         Auth[id][0] = 0     IP[id][0] = 0         return PLUGIN_CONTINUE } found_in_file(file[], auth[], name[]) {         if ( !file_exists(file) )         write_file(file, "")         new line, text[512], txtlen, write_text[512]         while( read_file(file, line++, text, 511, txtlen) ) {                 if ( contain(text, auth) !=-1 ) {                         if ( contain(text, name) == -1 ) {                                 formatex(write_text, 511, "^"%s^"/%s", name, text)                 write_file(file, write_text, line-1)             }             return 1         }     }         return 0 }

Last edited by [ --<-@ ] Black Rose; 09-17-2006 at 14:08.
[ --<-@ ] Black Rose 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 20:09.


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