AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   can't get console_print to work before disconnect (https://forums.alliedmods.net/showthread.php?t=83036)

Owyn 01-03-2009 07:16

can't get console_print to work before disconnect
 
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

shine771 01-03-2009 11:02

Re: can't get console_print to work before disconnect
 
Try client_cmd(client,"echo %s",string)

anakin_cstrike 01-03-2009 11:22

Re: can't get console_print to work before disconnect
 
Quote:

Originally Posted by shine771 (Post 737598)
Try client_cmd(client,"echo %s",string)

If you do that, you'll need:
PHP Code:

"echo ^"%s^""string ); 


Owyn 01-03-2009 13:26

Re: can't get console_print to work before disconnect
 
thx it worked +_+

Exolent[jNr] 01-03-2009 14:31

Re: can't get console_print to work before disconnect
 
Why are you fixing my plugin for me?

shine771 01-03-2009 17:12

Re: can't get console_print to work before disconnect
 
He's very kind, or he doesn't want to wait till you fix it yourself x.d.


All times are GMT -4. The time now is 09:08.

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