Raised This Month: $ Target: $400
 0% 

ID by IP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
6pack
BANNED
Join Date: Mar 2006
Location: Cedarhurst, Long Island
Old 02-27-2007 , 13:43   ID by IP
Reply With Quote #1

Can someone please tell me what do I have to change/do to make this plugin log ID's by IP's instead of steam ID's?

Thanks
Attached Files
File Type: sma Get Plugin or Get Source (storesteamid.sma - 662 views - 1.8 KB)
6pack is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-27-2007 , 13:51   Re: ID by IP
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define MAX_IN_FILE 500  

new pnum

public plugin_init() 

    
register_plugin("StoreSteamID","v0.5","Sandurr")
    
pnum register_cvar("sv_steamidname","1")


public 
client_putinserver(id

    
set_task(3.0"check_name"id
    return 
PLUGIN_CONTINUE 


public 
client_infochanged(id

    
check_name(id
    return 
PLUGIN_CONTINUE 
}

public 
check_name(id
{
    if(
get_pcvar_num(pnum) != 1)
        return 
PLUGIN_CONTINUE;

    new 
name[32], userip[32], line[256], lengthfile[256], configsdir[256], info[32
    
get_user_name(id,name,31
    
get_user_ip(id,userip,31,1)
     
    
get_configsdir(configsdir,255
    
format(file,255,"%s/storesteamid.cfg",configsdir)
 
    

    if(!
file_exists(file)) 
    { 
        
server_print("[SteamIDName] File does not exist! ^n"
        return 
PLUGIN_CONTINUE
    


    for(new 
i=0;i<MAX_IN_FILE;i++) 
    { 
        
format(line,255,""
        
read_file(file,i,line,255,length

        if(
containi(line,userip) != -1
        { 
            if(
containi(line,name) == -1
            { 
                
format(info,31,"|%s",name
                
add(line,255,info,31
                
write_file(file,line,i
                return 
PLUGIN_CONTINUE 
            

            else 
                return 
PLUGIN_CONTINUE 
        

    } 
    
format(info,31,"%s %s",userip,name
    
write_file(file,info,-1
    return 
PLUGIN_CONTINUE 

SAMURAI16 is offline
Send a message via MSN to SAMURAI16
6pack
BANNED
Join Date: Mar 2006
Location: Cedarhurst, Long Island
Old 02-27-2007 , 14:01   Re: ID by IP
Reply With Quote #3

Thanks, will try it out and another question, I want to change "define 500" to a much higher number, do I have to use a comma?
Example;
10000
or 10,000
6pack is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-27-2007 , 14:03   Re: ID by IP
Reply With Quote #4

what ?
change #define MAX_IN_FILE 500
with
#define MAX_IN_FILE 75095409865489654 if you want.
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
6pack
BANNED
Join Date: Mar 2006
Location: Cedarhurst, Long Island
Old 02-27-2007 , 14:15   Re: ID by IP
Reply With Quote #5

Quote:
Originally Posted by SAMURAI16 View Post
what ?
change #define MAX_IN_FILE 500
with
#define MAX_IN_FILE 75095409865489654 if you want.
in america we use a comma
10000
is 10,000
1000
is 1,000
dollars is 1,000.00

But you answered my question, thanks
6pack is offline
Martin1
BANNED
Join Date: May 2006
Old 02-28-2007 , 18:15   Re: ID by IP
Reply With Quote #6

well the commas in math are used to help you organize it, not for another reason
Martin1 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 00:34.


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