Raised This Month: $ Target: $400
 0% 

help with client check on client_connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 06-24-2009 , 12:14   help with client check on client_connect
Reply With Quote #1

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;

    }
}
Jack86 is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 06-24-2009 , 12:27   Re: help with client check on client_connect
Reply With Quote #2

Maybe sInfo is empty?

I had this problem when i installed dproto on my servers - problem with get_user_info()..
TheRadiance is offline
Send a message via ICQ to TheRadiance
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 06-24-2009 , 13:38   Re: help with client check on client_connect
Reply With Quote #3

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.

Last edited by Jack86; 06-24-2009 at 14:04.
Jack86 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-24-2009 , 14:59   Re: help with client check on client_connect
Reply With Quote #4

if(strlen(sInfo) > 0)
{

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

And see if that code is called.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2009 , 19:07   Re: help with client check on client_connect
Reply With Quote #5

Code:
if(strlen(sInfo) > 0)

Code:
if(sInfo[0])
__________________
fysiks is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 06-25-2009 , 05:48   Re: help with client check on client_connect
Reply With Quote #6

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.
Jack86 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-25-2009 , 18:58   Re: help with client check on client_connect
Reply With Quote #7

Quote:
Originally Posted by Jack86 View Post
this above doesnt change anything
I know, it was just an optimization.

Quote:
Originally Posted by Jack86 View Post
. . . 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.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-26-2009 , 09:17   Re: help with client check on client_connect
Reply With Quote #8

I've noticed that some things just do not work @ client_connect. Try your code at client_putinserver instead and see if it works.
__________________
Bugsy is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 06-26-2009 , 16:32   Re: help with client check on client_connect
Reply With Quote #9

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.
Jack86 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 15:35.


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