AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Kick player because of name (https://forums.alliedmods.net/showthread.php?t=121445)

Jelle 03-15-2010 17:29

Kick player because of name
 
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?

fysiks 03-15-2010 18:27

Re: Kick player because of name
 
Try this:

PHP Code:

removed.  See post 18. 

BTW, you need to use quotes around strings.

EDIT: UPdated.

Doc-Holiday 03-15-2010 18:27

Re: Kick player because of name
 
look at the clan tag protection plugin

Jelle 03-15-2010 18:36

Re: Kick player because of name
 
Thank you so much fysiks!

But there is no easier way of doing it? Making the plugin smaller by only using amxmodx include?

fysiks 03-15-2010 18:40

Re: Kick player because of name
 
Quote:

Originally Posted by Jelle (Post 1118600)
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.

Jelle 03-15-2010 18:48

Re: Kick player because of name
 
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?

wrecked_ 03-15-2010 19:06

Re: Kick player because of name
 
Quote:

Originally Posted by Jelle (Post 1118610)
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) ) 

:arrow:
PHP Code:

if( containi(valPLAYERNAME ) >= 

EDIT: containi returns -1 on failure, in case you were wondering.

fysiks 03-15-2010 19:09

Re: Kick player because of name
 
Quote:

Originally Posted by Jelle (Post 1118610)
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."

Bugsy 03-15-2010 21:50

Re: Kick player because of name
 
That's technically not preventing the name change. You are just changing it once it's changed.

Seta00 03-15-2010 21:51

Re: Kick player because of name
 
Quote:

Originally Posted by Bugsy (Post 1118782)
That's technically not preventing the name change. You are just changing it once it's changed.

And it doesn't work.


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

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