Raised This Month: $ Target: $400
 0% 

Logging player problem?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-29-2010 , 22:57   Re: Logging player problem?
Reply With Quote #6

Got it working without the lang file . Thanks for the help fysiks.
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <celltrie>

#define PLUGIN "logging"
#define VERSION "1.0"
#define AUTHOR "Server Owner"

new Trie:gSteamIDTrie
new gszFile[64]
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_logevent("round_start", 2, "1=Round_Start")
}

public round_start()
{
    new info[36]
    new players[32], player, num
    new authid[32], name[32]
    gSteamIDTrie=TrieCreate()
    get_localinfo( "amxx_configsdir", gszFile, 63 )
    new const text[64]="Server Player Log File"
    new const logs[64]="addons/amxmodx/configs/logs.txt"
    if(!file_exists(logs))
    write_file(logs, text)
    
    new file=fopen( logs, "rt" )
    while( !feof(file) )
    {
        fgets( file, info, charsmax(info) )
        trim(info)
        TrieSetCell(gSteamIDTrie, info, 1)
    }
    fclose(file)
    get_players(players, num)
    for( new i; i<num; i++ )
    {
        player=players[i]
        get_user_authid( player, authid, charsmax(authid) )
        get_user_name( player, name, 31 )
        if( !TrieKeyExists( gSteamIDTrie, authid ) )
        {
            write_file( logs, name )
            write_file( logs, authid )
            client_print(0, print_chat, "%s has never played in this server before, please welcome him!", name)
        }
        
    }
}

Last edited by nikhilgupta345; 07-29-2010 at 23:04.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 



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:13.


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