|
Senior Member
Join Date: Nov 2014
Location: Groznyj, Chechnya
|

01-10-2015
, 10:10
Re: Request one name
|
#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(id, pev_netname, szOldName, charsmax(szOldName)) if( szOldName[0] ) { get_user_info(id, name, szNewName, charsmax(szNewName)) if( !equal(szOldName, szNewName) ) { if(contor[id] < 3) { ++contor[id]; } else { client_print(id, print_chat ,"[NICK] You can change your nick for only 3 times!"); set_user_info(id, name, szOldName) 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_plugin( PLUGIN, VERSION, AUTHOR ) register_message(get_user_msgid("SayText"), "MessageZeniX"); }
public client_infochanged ( id ) { if (is_user_connected(id )) { new newname [ 32 ], oldname [ 32 ] get_user_info( id, "name", newname, 31 ) get_user_name( id, oldname, 31 ) if (!equal(oldname,newname)) { client_print(id, print_console, "*******************************************************") client_print(id, print_console, "********************* BLOCK NICK CHANGER **************") client_print(id, print_console, "******** You're not allowed to change the nick ********") client_print(id, print_console, "*******************************************************") client_print(id, print_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 ( msgid, dest, receiver ) { static info [ 64 ]; get_msg_arg_string(2, info, sizeof(info) - 1); if( !equali(info, "#Cstrike_Name_Change") ) return PLUGIN_CONTINUE; return PLUGIN_HANDLED; }
stock color_chat(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3) replace_all(msg, 190, ".v", "^4") replace_all(msg, 190, ".g", "^1") replace_all(msg, 190, ".e", "^3") if (id) players[0] = id; else get_players(players, count, "ch") { for (new i = 0; i < count; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]) write_byte(players[i]); write_string(msg); message_end(); } } } }
Last edited by choloo; 01-10-2015 at 10:11.
|
|