Raised This Month: $ Target: $400
 0% 

ID by IP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-27-2007 , 13:51   Re: ID by IP
Reply With Quote #1

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 #2

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
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