Raised This Month: $51 Target: $400
 12% 

amx_nickreservation PLZ HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cyrAss
New Member
Join Date: Nov 2006
Old 11-12-2006 , 09:14   amx_nickreservation PLZ HELP
Reply With Quote #1

Code:
#include <amxmodx>
#include <file>
#include <string>

public plugin_init()
{
    register_plugin("EXAMPLE NAME RESERVATION","0.1","EXAMPLE NICK")
}

public client_connect(id)
{
    log_info(id)
}

public client_infochanged(id) 
{
    if (!is_user_connected(id) || !get_cvar_num("amx_mode"))
        return PLUGIN_CONTINUE 
    
    new newname[32], oldname[32]
    get_user_name(id, oldname, 31)
    get_user_info(id, "name", newname, 31)

    if (!equal(newname, oldname))
        log_info(id)
    return PLUGIN_CONTINUE
}

public log_info(id)
{
    new nick[50],pass[50],tmp[100],tmpNick[50],tmpPass[50],st[100],i,a,len,CurrentTime[25]
    nick=""
    get_user_info(id, "name", nick, 31)
    i=-1
    a=0
    while(i!=0)
    {
        tmpNick=""
        tmpPass=""
        tmp=""
        i=read_file("addons/amxmodx/nicks.txt",a,tmp,100,len)
        parse(tmp,tmpNick,50,tmpPass,50)
        if(equal(tmpNick,nick))
        {
            get_user_info(id,"ledsplej_password",pass,50)
            if(equal(tmpPass,pass))
            {
                CurrentTime=""
                get_time("%Y.%d.%m - %H:%M:%S - ",CurrentTime,25)
                st=""
                add(st,100,CurrentTime)
                add(st,100," - ")
                add(st,100,nick)
                add(st,100,"::")
                add(st,100,"OK")
                write_file("addons/amxmodx/nicks.log",st)
            } else
            {
                CurrentTime=""
                get_time("%Y.%d.%m - %H:%M:%S - ",CurrentTime,25)
                st=""
                add(st,100,CurrentTime)
                add(st,100," - ")
                add(st,100,nick)
                add(st,100,"::")
                add(st,100,"XX")
                write_file("addons/amxmodx/nicks.log",st)
                client_cmd(id,"echo ^"EXAMPLE.^";disconnect")
            }
        }
        a++
    }
    
}
i need help with this plugin... i dont know what write to add "user nick" or what write in the other file just dont know what to do next... please help

Last edited by cyrAss; 11-12-2006 at 15:11.
cyrAss 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 13:16.


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