
/* AMX Mod script.
* Revised to fit STEAM ID's an IP's in the same text.
* Make a "steamid" directory in the folder of your "mod"
* 
*
* Original code "WonID Logger Plugin"
*  by |SNap|
*
* Based on Lastname plugin
*  by JustinHoMi
*/

#include <amxmod>

new logdir[32] = "steamid"

public client_connect(id){

    new authid[17],name[33],IPAddy[33]
    get_user_authid(id,authid,16)
    get_user_name(id,name,32)
    get_user_ip(id,IPAddy,32,1)
    new logfile[64]
    format(logfile,255,"%s/%s",logdir,authid);
    write_file(logfile,name,-1)
    write_file(logfile,IPAddy,-1);

    return PLUGIN_CONTINUE
}


public client_infochanged(id){
    if (is_user_connected(id)){
        new newname[33], oldname[33]
        get_user_info(id, "name", newname,32)
        get_user_name(id,oldname,32)

        if (!equal(oldname,newname)){
            new authid[17]
            get_user_authid(id,authid,16)
            new logfile[64]
            format(logfile,255,"%s/%s",logdir,authid);
            write_file(logfile,newname,-1);

         }
    }
    return PLUGIN_CONTINUE
}

public plugin_init(){
    register_plugin("STEAMID_Logger","0.9.7","StoNeD")
    return PLUGIN_CONTINUE
}


