Raised This Month: $ Target: $400
 0% 

forbid to change nick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
krekers
Junior Member
Join Date: Jul 2007
Old 12-02-2007 , 06:44   forbid to change nick
Reply With Quote #1

I want to forbid command name in server. How can detect user nickchanging? I don't know how to perform it. Can somebody help me with that script?
krekers is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-02-2007 , 07:47   Re: forbid to change nick
Reply With Quote #2

Code:
#include <amxmodx> #if AMXX_VERSION_NUM < 180     #define charsmax(%1)    (sizeof(%1)-1) #endif #define MAX_PLAYERS 32 new const g_NameChange[] = "#Cstrike_Name_Change" new const g_NameInfo[] = "name" new const g_NotAllowed[] = "** You are not allowed to change your name" new bool:dontcheck[MAX_PLAYERS+1] public plugin_init() {     register_plugin("One Name", "1.0", "default")     register_message(get_user_msgid("SayText") , "msg_SayText") } public msg_SayText(msg_id, msg_dest, msg_entity) {     new arg2[32]     get_msg_arg_string(2, arg2, charsmax(arg2))     if(equal(arg2, g_NameChange))         return PLUGIN_HANDLED     return PLUGIN_CONTINUE } public client_infochanged(id) {     if(dontcheck[id])     {         dontcheck[id] = false     }     else if(is_user_connected(id))     {         new newname[32], oldname[32]         get_user_info(id, g_NameInfo, newname, charsmax(newname))         get_user_name(id, oldname, charsmax(oldname))         if(!equal(oldname,newname))         {             dontcheck[id] = true             client_print(id, print_chat, g_NotAllowed)             set_user_info(id, g_NameInfo, oldname)         }     } }
Attached Files
File Type: sma Get Plugin or Get Source (One_Name.sma - 675 views - 1.1 KB)
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 11:00.


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