Raised This Month: $ Target: $400
 0% 

Logging player problem?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-28-2010 , 22:38   Logging player problem?
Reply With Quote #1

Hi, I tried making a plugin that logs a player's steamid and name (I've done this before) but this time, I'm trying to make it so that if their name is already in the txt file, don't write it again. This is the code I have:

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Logging"
#define VERSION "1.0"
#define AUTHOR "nikhilgupta345"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_dictionary("steamids.txt")
    register_logevent("round_start", 2, "1=Round_Start")
}

public round_start()
{
    
    new players[32], player, num
    new readfile[256]
    new filewrite=fopen("addons/amxmodx/configs/logs.txt", "wt")
    new fileread=fopen("addons/amxmodx/configs/logs.txt", "rt")
    get_players(players, num)
    for(new i;i<num;i++)
    {
        while(!feof(fileread))
        {
            fgets(fileread, readfile, charsmax(readfile))
        new authid[32], name[32]
        player=players[i]
        get_user_name(player, name, 31)
        get_user_authid(player, authid, 31)
        if(!(containi(readfile, name)) || !(containi(readfile, authid)))
        {
            fprintf(filewrite, "%s-%s", name, authid)
            client_print(0, print_chat, "[Dust2 Pub] %L", LANG_PLAYER, "NAME_LOGGED", name)
        }
    }
        }
    
}
When I join my server and when the round starts, doesn't print anything to cleint, and when I check logs.txt (I made it myself, the plguin didn't make it), nothing is in it :/

Last edited by nikhilgupta345; 07-28-2010 at 22:42.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
 


Thread Tools
Display Modes

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