Raised This Month: $ Target: $400
 0% 

Kick player because of name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2010 , 17:29   Kick player because of name
Reply With Quote #1

Hi there.

I am sick and tired of people keep using my name in my server, so I decided to try and make a small plugin witch just checks the users name and authid and see if it is really me who is using the name Jelle.

But I am not sure how to do this.
I get the following error:
Code:
Error: Undefined symbol "Jelle" on line 19
Warning: Tag mismatch on line 25
Error: Expected token: ")", but found ":" on line 25
How do I set it so Jelle is the name it checks?

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLAYERNAME Jelle
#define AUTHID STEAM_0:1:123456789

public plugin_init()
{
    
register_plugin("Anti Fake Admin""1.0""Jelle")
}

public 
client_putinserver(id)
{
    new 
PlayerName[32]
    
    
get_user_name(idPlayerName31)
    
    if ( 
PlayerName[id] != PLAYERNAME ) return
    
    new 
authID[32]
    
    
get_user_authid(idauthID31)
    
    if ( 
authID[id] != AUTHID )
    {
        
server_cmd("kick %s You are not an admin and must therefor not use this name")
    }

Thanks in advance.

EDIT: Just realized that they can join with the name "Hello" and change their name to Jelle once they are connected without anything happens.
So... Next question. How do I keep track of who is changing their names?
__________________
No idea what to write here...

Last edited by Jelle; 03-15-2010 at 17:53.
Jelle is offline
Send a message via MSN to Jelle
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-15-2010 , 18:27   Re: Kick player because of name
Reply With Quote #2

Try this:

PHP Code:
removed.  See post 18. 
BTW, you need to use quotes around strings.

EDIT: UPdated.
__________________

Last edited by fysiks; 03-16-2010 at 20:49.
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 03-15-2010 , 18:27   Re: Kick player because of name
Reply With Quote #3

look at the clan tag protection plugin
Doc-Holiday is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2010 , 18:36   Re: Kick player because of name
Reply With Quote #4

Thank you so much fysiks!

But there is no easier way of doing it? Making the plugin smaller by only using amxmodx include?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-15-2010 , 18:40   Re: Kick player because of name
Reply With Quote #5

Quote:
Originally Posted by Jelle View Post
Thank you so much fysiks!

But there is no easier way of doing it? Making the plugin smaller by only using amxmodx include?
You can't stop someone from changing their name without fakemeta.
__________________
fysiks is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2010 , 18:48   Re: Kick player because of name
Reply With Quote #6

Oh okay.

Well big thanks. You have been most helpful.

But what if a player changes name to "Jelle1"?
Is there an easy way to check the first 5 letters of a players name, and if it is equal "Jelle", then check for authID?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-15-2010 , 19:06   Re: Kick player because of name
Reply With Quote #7

Quote:
Originally Posted by Jelle View Post
Oh okay.

Well big thanks. You have been most helpful.

But what if a player changes name to "Jelle1"?
Is there an easy way to check the first 5 letters of a players name, and if it is equal "Jelle", then check for authID?
PHP Code:
if( equal(valPLAYERNAME) ) 

PHP Code:
if( containi(valPLAYERNAME ) >= 
EDIT: containi returns -1 on failure, in case you were wondering.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-15-2010 , 19:09   Re: Kick player because of name
Reply With Quote #8

Quote:
Originally Posted by Jelle View Post
But what if a player changes name to "Jelle1"?
Is there an easy way to check the first 5 letters of a players name, and if it is equal "Jelle", then check for authID?
Done. You can also change equal( to equali( so it would catch "jelle" and "JeLLe" and the like.

In addition to wrecked's respones:

Using containi() would catch things like "1jeLLe3."
__________________

Last edited by fysiks; 03-15-2010 at 19:11.
fysiks is offline
Old 03-15-2010, 21:37
Seta00
This message has been deleted by Seta00. Reason: doesn't work
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-15-2010 , 21:50   Re: Kick player because of name
Reply With Quote #9

That's technically not preventing the name change. You are just changing it once it's changed.
__________________
Bugsy is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-15-2010 , 21:51   Re: Kick player because of name
Reply With Quote #10

Quote:
Originally Posted by Bugsy View Post
That's technically not preventing the name change. You are just changing it once it's changed.
And it doesn't work.
Seta00 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 08:41.


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