Raised This Month: $ Target: $400
 0% 

Request one name


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
choloo
Senior Member
Join Date: Nov 2014
Location: Groznyj, Chechnya
Old 01-10-2015 , 10:10   Re: Request one name
Reply With Quote #5

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();
      }
   }
}


Last edited by choloo; 01-10-2015 at 10:11.
choloo is offline
 



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 23:15.


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