Raised This Month: $32 Target: $400
 8% 

name/kick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 01-25-2007 , 14:03   name/kick
Reply With Quote #1

What is wrong with this code, it is only kicking people with names like "[Cheater] Nick", but I want it to kick players with "[Cheater]Nick"; when they connect and in-game.


Code:
please see the code below

Last edited by Pamaliska; 01-26-2007 at 12:05.
Pamaliska is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 01-25-2007 , 18:43   Re: name/kick
Reply With Quote #2

the part containing the switch is never executed, because you close way too much methods

"} } }" the ones after the "return"

post the whole code pls because now it looks like you only showed a tiny bit and it ain't even parts that follow each other due to the "}"
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 01-25-2007 , 19:21   Re: name/kick
Reply With Quote #3

*Re-opened*
Any suggstions, because I am clueless. It kicks players with [Cheater]Nick, but it also kicks players with such names as [clan tag]^Nick, or Nick@; why is it happening, the code shoud not check for special signs, but it does and kicks them.

Code:
  register_plugin(PLUGIN, VERSION, AUTHOR)
}
public kick(id)
{
        server_cmd("kick #%d ^"MY MESSAGE^"", get_user_userid(id))
}
public client_infochanged(id)
    {
        new name[32]
        get_user_name(id, name, 31)
        if(containi(name, "Cheater") != -1)
{
             kick(id)
             return
}
        new i, c
        while((c = name[i++]))
        {
                switch(c)
                {
                        case 33, 35, 36, 37, 38, 40, 41, 42, 64, 94, 123, 125:
                        {
                                kick(id)
                                return
                        }
                }
        }
}
P.S. that is the complete piece of code.

Last edited by Pamaliska; 01-26-2007 at 12:06.
Pamaliska is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 01-26-2007 , 15:23   Re: name/kick
Reply With Quote #4

ill take a look for it

so you want to kick players with the name [Cheater]xxxxxxxxxxxxxxxxx
xxxx = their nickname

and not the players with the name [Cheater]^xxxxxxxxxxxx

right?
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 01-27-2007 , 05:46   Re: name/kick
Reply With Quote #5

That is correct. Right now it even kicks players with such nicks as Johny@ or [Masters]^Stewart. I want to kick player only if their nick looks like this one: [Cheater]xxxxxxxx, not like [Cheater] xxxxxxx, or a nick with any special character. I am not even checking for any special characters.

Cheers.
Pamaliska is offline
s p l i t
Senior Member
Join Date: May 2006
Location: US, NC
Old 01-28-2007 , 16:13   Re: name/kick
Reply With Quote #6

Code:
new name[32] get_user_name(id, name, 31) if(name[0]='[' && name[1]='C' && name[2]='h' && name[3]='e' && name[4]='a' && name[5]='t' && name[6]='e' && name[7]='r' && name[8]=']' ){    //... }
s p l i t is offline
Send a message via AIM to s p l i t Send a message via MSN to s p l i t
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 01-28-2007 , 16:19   Re: name/kick
Reply With Quote #7

I'll try it right now.

warning 211:possibly unintended assignment
warning 211:possibly unintended assignment
error 022: must be lvalue (non-constant)
error 022: must be lvalue (non-constant)
error 022: must be lvalue (non-constant)
fatal error 107: too many error messages on one line

Last edited by Pamaliska; 01-28-2007 at 16:25.
Pamaliska is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-28-2007 , 16:34   Re: name/kick
Reply With Quote #8

Code:
new name[32] get_user_name(id, name, 31) if(name[0]=='[' && name[1]=='C' && name[2]=='h' && name[3]=='e' && name[4]=='a' && name[5]=='t' && name[6]=='e' && name[7]=='r' && name[8]==']' ){    //... }

split
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 01-28-2007 , 18:13   Re: name/kick
Reply With Quote #9

Quote:
Originally Posted by Emp` View Post
Code:
new name[32] get_user_name(id, name, 31) if(name[0]=='[' && name[1]=='C' && name[2]=='h' && name[3]=='e' && name[4]=='a' && name[5]=='t' && name[6]=='e' && name[7]=='r' && name[8]==']' ){    //... }

split
error 054: unmatched closing brace
error 010: invalid function or declaration
error 010: invalid function or declaration
error 010: invalid function or declaration
error 021: symbol already defined: "kick"
error 054: unmatched closing brace
warning 203: symbol is never used: "c"
warning 203: symbol is never used: "i"
Pamaliska is offline
s p l i t
Senior Member
Join Date: May 2006
Location: US, NC
Old 01-28-2007 , 19:05   Re: name/kick
Reply With Quote #10

aha, thanks emp

pamaliska, it should work fine. Post your whole code.
s p l i t is offline
Send a message via AIM to s p l i t Send a message via MSN to s p l i t
Reply


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 07:20.


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