Raised This Month: $ Target: $400
 0% 

can't get console_print to work before disconnect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-03-2009 , 07:16   can't get console_print to work before disconnect
Reply With Quote #1

i have a ban script replacing amxbans, and my problem is when someone banned connects to server he only see "You are banned, check your console" but nothing prints there, just this message

here's a check ip and disconnect function

Code:
public client_authorized(client)
{
    new authid[35];
    get_user_authid(client, authid, sizeof(authid) - 1);
    
    new ip[64];
    get_user_ip(client, ip, sizeof(ip) - 1, 1);
    
    new banned_authid[64], bool:is_ip;
    for( new i = 0; i < g_total_bans; i++ )
    {
        ArrayGetString(g_steamids, i, banned_authid, sizeof(banned_authid) - 1);
        
        is_ip = bool:(containi(banned_authid, ".") != -1);
        
        if( is_ip && equal(ip, banned_authid) || !is_ip && equal(authid, banned_authid) )
        {
            new website[64];
            get_pcvar_string(ab_website, website, sizeof(website) - 1);
            
            new name[32], reason[128], unbantime[32], admin_name[32], admin_steamid[64];
            ArrayGetString(g_names, i, name, sizeof(name) - 1);
            ArrayGetString(g_reasons, i, reason, sizeof(reason) - 1);
            new banlength = ArrayGetCell(g_banlengths, i);
            ArrayGetString(g_unbantimes, i, unbantime, sizeof(unbantime) - 1);
            ArrayGetString(g_admin_names, i, admin_name, sizeof(admin_name) - 1);
            ArrayGetString(g_admin_steamids, i, admin_steamid, sizeof(admin_steamid) - 1);
            
            console_print(client, "************************************************");
            console_print(client, "%L:", client, "AB_BAN_INFORMATION");
            console_print(client, "%L: %s", client, "AB_NAME", name);
            console_print(client, "%L: %s", client, is_ip ? "AB_IP" : "AB_STEAMID", banned_authid);
            console_print(client, "%L: %s", client, "AB_REASON", reason);
            if( banlength > 0 )
            {
                new length[64];
                GetBanTime(banlength, length, sizeof(length) - 1);
                
                console_print(client, "%L: %s", client, "AB_BAN_LENGTH", length);
            }
            console_print(client, "%L: %s", client, "AB_UNBAN_TIME", unbantime);
            console_print(client, "%L: %s", client, "AB_ADMIN_NAME", admin_name);
            console_print(client, "%L: %s", client, "AB_ADMIN_STEAMID", admin_steamid);
            if( website[0] )
            {
                console_print(client, "");
                console_print(client, "%L", client, "AB_WEBSITE");
                console_print(client, "%s", website);
            }
            console_print(client, "************************************************");
            
            set_task(1.0, "TaskDisconnectPlayer", client);
            break;
        }
    }
}

public TaskDisconnectPlayer(client)
{
    server_cmd("kick #%i ^"You are banned from this server. Check your console^"", get_user_userid(client));
}
say if you need full code

Last edited by Owyn; 01-03-2009 at 07:56.
Owyn is offline
Send a message via ICQ to Owyn
 



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 09:08.


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