AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Request one name (https://forums.alliedmods.net/showthread.php?t=255024)

Emanuel 01-09-2015 14:54

Request one name
 
Hi guys i want a plugin : when you enter in server you cant chenge name :) and say Sorry but for you chenge name leave server and change .

WildCard65 01-09-2015 15:16

Re: Request one name
 
Quote:

Originally Posted by Emanuel (Post 2247072)
Hi guys i want a plugin : when you enter in server you cant chenge name :) and say Sorry but for you chenge name leave server and change .

and why do you want to enforce everyone to always use 1 name?

wickedd 01-09-2015 15:37

Re: Request one name
 
PHP Code:

#include <amxmodx>
#include <fakemeta>

#define VERSION "0.1.0"

public plugin_init()
{
    
register_plugin("One Name"VERSION"ConnorMcLeod")
    
register_forward(FM_ClientUserInfoChanged"ClientUserInfoChanged")
}

public 
ClientUserInfoChanged(id)
{
    static const 
name[] = "name"
    
static szOldName[32], szNewName[32]
    
pev(idpev_netnameszOldNamecharsmax(szOldName))
    if( 
szOldName[0] )
    {
        
get_user_info(idnameszNewNamecharsmax(szNewName))
        if( !
equal(szOldNameszNewName) )
        {
            
set_user_info(idnameszOldName)
            
client_print(idprint_chat" Put your message here" )
            return 
FMRES_HANDLED
        
}
    }
    return 
FMRES_IGNORED 



fysiks 01-09-2015 18:07

Re: Request one name
 
Quote:

Originally Posted by WildCard65 (Post 2247084)
and why do you want to enforce everyone to always use 1 name?

That's not unusual. The server that I play on has that rule so that it doesn't become a habit to simply change name to evade being detected for breaking server rules. However, it is only lenforced it verbally.

choloo 01-10-2015 10:10

Re: Request one name
 
BlockChangeName (Allow players to change their names 3 times + message)
PHP Code:

#include <amxmodx>
#include <fakemeta> 

new contor[32]

public 
plugin_init() 
{
   
register_plugin("Block change name","0.2.0","ConnorMcLeod"); // real name is "One Name"
   
register_forward(FM_ClientUserInfoChanged"ClientUserInfoChanged");
}

public 
ClientUserInfoChanged(id

    static const 
name[] = "name" 
    
static szOldName[32], szNewName[32
    
pev(idpev_netnameszOldNamecharsmax(szOldName)) 
    if( 
szOldName[0] ) 
    { 
        
get_user_info(idnameszNewNamecharsmax(szNewName)) 
        if( !
equal(szOldNameszNewName) ) 
        { 
            if(
contor[id] < 3)
            {
             ++
contor[id];
            }
            else
            { 
              
client_print(idprint_chat ,"[NICK] You can change your nick for only 3 times!");
              
set_user_info(idnameszOldName
              return 
FMRES_HANDLED
            
}
        } 
    } 
    return 
FMRES_IGNORED 


BlockNickChanger (Players can't change their names + message in console)
PHP Code:

/*
by ZeniX aka lucylucy
*/

#include < amxmodx >

#define PLUGIN "No Name Change"
#define VERSION "0.1"
#define AUTHOR "ZeniX aka lucylucy"

public plugin_init ( ) {
   
   
register_pluginPLUGINVERSIONAUTHOR )
   
   
register_message(get_user_msgid("SayText"), "MessageZeniX");
   
}

public 
client_infochanged id ) {
   
   if (
is_user_connected(id )) {
      
      new 
newname 32 ], oldname 32 ]
      
get_user_infoid"name"newname31 )
      
get_user_nameidoldname31 )
      
      if (!
equal(oldname,newname)) {
         
client_print(idprint_console"*******************************************************")
         
client_print(idprint_console"********************* BLOCK NICK CHANGER **************")
         
client_print(idprint_console"******** You're not allowed to change the nick ********")
         
client_print(idprint_console"*******************************************************")
         
client_print(idprint_console"********************* BLOCK NICK CHANGER **************")
         
color_chat(id"^1[^4BLOCK^1-^4NICK-CHANGER^1]^4 You're not allowed to change the nick on this server. ^1[^4Your_Server_here^1]")
         
         
set_user_info(id,"name",oldname)
         
      }
   }
   
   return 
PLUGIN_CONTINUE
}

public 
MessageZeniX msgiddestreceiver ) {
   
   static 
info 64 ];
   
get_msg_arg_string(2infosizeof(info) - 1);
   
   if( !
equali(info"#Cstrike_Name_Change") ) return PLUGIN_CONTINUE;
   
   return 
PLUGIN_HANDLED;
   
}

stock color_chat(const id, const input[], any:...)
{
   new 
count 1players[32]
   static 
msg[191]
   
vformat(msg190input3)
   
   
replace_all(msg190".v""^4")
   
replace_all(msg190".g""^1")
   
replace_all(msg190".e""^3")
   
   if (
idplayers[0] = id; else get_players(playerscount"ch")
   {
   for (new 
0counti++)
   {
      if (
is_user_connected(players[i]))
      {
         
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
         
write_byte(players[i]);
         
write_string(msg);
         
message_end();
      }
   }
}



plazma 01-10-2015 11:08

Re: Request one name
 
Can make anyone this for me when player change name on 3 time get kicked from server ?

PHP Code:

public ClientUserInfoChanged(id

    static const 
name[] = "name" 
    
static szOldName[32], szNewName[32
    
pev(idpev_netnameszOldNamecharsmax(szOldName)) 
    if( 
szOldName[0] ) 
    { 
        
get_user_info(idnameszNewNamecharsmax(szNewName)) 
        if( !
equal(szOldNameszNewName) ) 
        { 
            if(
contor[id] < 3)
            {
             ++
contor[id];
            }
            else
            { 
              
client_print(idprint_chat ,"[NICK] You can change your nick for only 3 times!");
              
set_user_info(idnameszOldName
              return 
FMRES_HANDLED
            
}
        } 
    } 
    return 
FMRES_IGNORED 



choloo 01-10-2015 11:18

Re: Request one name
 
Why you want to kick players? They are not allowed to change nick anymore, they don't disturb the server after 3 changes :|

plazma 01-10-2015 11:21

Re: Request one name
 
Quote:

Originally Posted by choloo (Post 2247435)
Why you want to kick players? They are not allowed to change nick anymore, they don't disturb the server after 3 changes :|

I need it for me, when he change name on 3 time get kick, can u make this? thank you !

ghost95v 01-10-2015 11:39

Re: Request one name
 
PHP Code:

public ClientUserInfoChanged(id

    static const 
name[] = "name" 
    
static szOldName[32], szNewName[32]
    new 
userid get_user_useridid );    
    
pev(idpev_netnameszOldNamecharsmax(szOldName)) 
    if( 
szOldName[0] ) 
    { 
        
get_user_info(idnameszNewNamecharsmax(szNewName)) 
        if( !
equal(szOldNameszNewName) ) 
        { 
            if(
contor[id] < 3)
            {
             ++
contor[id];
            }
            else
            { 
              
client_print(idprint_chat ,"[NICK] You can change your nick for only 3 times!");
              
server_cmd"kick #%d ^"Stop Changing the name!^""userid );
              return 
FMRES_HANDLED
            
}
        } 
    } 
    return 
FMRES_IGNORED 



plazma 01-10-2015 12:51

Re: Request one name
 
Solved!

PHP Code:

public ClientUserInfoChanged(id

    static const 
name[] = "name" 
    
static szOldName[32], szNewName[32
    
pev(idpev_netnameszOldNamecharsmax(szOldName)) 
    if( 
szOldName[0] ) 
    { 
        
get_user_info(idnameszNewNamecharsmax(szNewName)) 
        if( !
equal(szOldNameszNewName) ) 
        { 
            if(
contor[id] < 3)
            {
             ++
contor[id];
            }
            else
            { 
              
client_print(idprint_chat ,"[NICK] You can change your nick for only 3 times!");
              
server_cmd"kick #%d ^"You can change your nick for only 3 times!^""get_user_userid(id));
              
set_user_info(idnameszOldName
              return 
FMRES_HANDLED
            
}
        } 
    } 
    return 
FMRES_IGNORED 




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

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