AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   forbid to change nick (https://forums.alliedmods.net/showthread.php?t=63879)

krekers 12-02-2007 06:44

forbid to change nick
 
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?

ConnorMcLeod 12-02-2007 07:47

Re: forbid to change nick
 
1 Attachment(s)
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)         }     } }


All times are GMT -4. The time now is 11:00.

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