AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with client check on client_connect (https://forums.alliedmods.net/showthread.php?t=95519)

Jack86 06-24-2009 12:14

help with client check on client_connect
 
This is a section of one plugin where everything else works ok, just this check doesnt. Whats wrong here ?

Code:

public client_connect(id)
{
    new sInfo[32], name[32], ip[32], cstr[32];
    get_user_name(id, name, 31);
    get_user_info(id, gBanKey, sInfo, sizeof sInfo - 1);
    get_user_ip(id, ip, 31, 1);
    get_pcvar_string(banurl,cstr,31);
   
    if(strlen(sInfo) > 0)
    {
        log_amx("Banned user (%s - %s ) tried to enter onto server", name, ip);
        server_cmd("amx_banip %s 9999 ^"Banned, for unban visit %s^"", name, cstr);
        server_exec();
        return;

    }
}


TheRadiance 06-24-2009 12:27

Re: help with client check on client_connect
 
Maybe sInfo is empty?

I had this problem when i installed dproto on my servers - problem with get_user_info()..

Jack86 06-24-2009 13:38

Re: help with client check on client_connect
 
It's not empty, i tested it, the weird thing is that this code works fine when there is
server_cmd("kick %s...
but it doesnt work with amx_banip or any other ban command. Also i tried with client_putinserver and client_authorized and it didnt work.

ConnorMcLeod 06-24-2009 14:59

Re: help with client check on client_connect
 
if(strlen(sInfo) > 0)
{

After this, try to put client_print(id, print_console, "something")

And see if that code is called.

fysiks 06-24-2009 19:07

Re: help with client check on client_connect
 
Code:

if(strlen(sInfo) > 0)
:arrow:
Code:

if(sInfo[0])

Jack86 06-25-2009 05:48

Re: help with client check on client_connect
 
Ok, I tried ^ and Connor's sugestion, this above doesnt change anything ,and when i tested it with print and nothing was shown, although i know it calls those commands 'cause there are log entries. I thought that there's something wrong with amxx and that's why kick works but not any ban command, and i tried with
server_cmd("addip 9999 %s;wait;writeip", ip);
it works that way just for few seconds, and after that server responds again.
Also when i tested on dedicated from my pc everything worked great but it doesnt work on my rented server. I tried to put plugin on top of list in plugins.ini, still nothing.

fysiks 06-25-2009 18:58

Re: help with client check on client_connect
 
Quote:

Originally Posted by Jack86 (Post 856566)
this above doesnt change anything

I know, it was just an optimization.

Quote:

Originally Posted by Jack86 (Post 856566)
. . . and when i tested it with print and nothing was shown, although i know it calls those commands 'cause there are log entries.

If the server_print() was not executed then your if() statement was not executed. If you actually get that log entry then you should be getting the server_print() also.

BTW, 9999 is not a permanent ban.

Bugsy 06-26-2009 09:17

Re: help with client check on client_connect
 
I've noticed that some things just do not work @ client_connect. Try your code at client_putinserver instead and see if it works.

Jack86 06-26-2009 16:32

Re: help with client check on client_connect
 
I tried that, didnt make any difference. The best solution i've come up so far are combining kick and addip commands, although it bans for only few secs, it better than non-working amx ban commands.


All times are GMT -4. The time now is 15:35.

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