Raised This Month: $ Target: $400
 0% 

get_user_authid doesnt return steamid


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mrcoffee
Junior Member
Join Date: Jul 2006
Old 10-08-2006 , 17:33   get_user_authid doesnt return steamid
Reply With Quote #1

I'm trying to make a plugin that will add players steamid's to a sql DB. The problem I'm having is that get_user_authid will only return "83" instead of "STEAM_X:X:XXXXXX". I know that the players steamid's arn't pending as other plugins that grab their id's are working fine. The code (below) is pretty simple so does anyone have any solutions or ideas as to why the function isn't working properly?

Code:
#include <amxmodx>
#include <amxmisc>
#include <dbi>

#define PLUGIN "Regs register"
#define VERSION "1.0"
#define AUTHOR "mrcoffee"

#define    REG_PLAYER    ADMIN_LEVEL_G
new Sql:dbc
new config_dir[256]
new connect_detail[4][32]
new userid[32]

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    // DB parameters
    register_srvcmd("amx_regsregister_connect", "get_login")
    
    get_configsdir(config_dir, 255)
    server_cmd("exec %s/regsregister.cfg", config_dir)
    set_task(0.1,"connect_db")
}


public get_login()
{
    if (read_argc() != 5)
    {
        log_amx("Invalid amx_regsregister_connect format")
        return 0
    }
    read_argv(1, connect_detail[0], 31)
    read_argv(2, connect_detail[1], 31)
    read_argv(3, connect_detail[2], 31)
    read_argv(4, connect_detail[3], 31)
    return 1
}


public connect_db()
{    
    dbc = dbi_connect(connect_detail[0],connect_detail[1],connect_detail[2],connect_detail[3])
    if (dbc < SQL_OK)
    {
        new error[255]
        new error_num = dbi_error(dbc,error,254)
        server_print("Connection to regs register DB failed: (%d) %s", error_num, error)
        log_amx("connection to regs register DB failed: (%d) %s", error_num, error)
    }
    else
    {
        server_print("Connected to regs register DB ")
        log_amx("Connected to regs register DB")
    }
}


public client_putinserver(id)
{
    if (access(id, REG_PLAYER))
    {
        if (get_cvar_num("sv_regsonly") == 1 || get_cvar_num("sv_regsonly") == 2)
        {
            set_task(15.0, "get_steamid", id)
        }
    }
}

public client_disconnect(id)
{
    remove_task(id)
}

public get_steamid(id)
{
    get_user_authid(id, userid,31)
    dbi_query(dbc,"INSERT INTO regs_register VALUES ('',NOW(),'%d')",userid)
    client_print(0,print_chat,"authid %d and id %i inserted into DB",userid,id)
}
mrcoffee is offline
 


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 04:53.


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