AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Not display msg of change name (https://forums.alliedmods.net/showthread.php?t=82286)

L// 12-20-2008 12:21

Not display msg of change name
 
There is any way to not display the message of change name?

anakin_cstrike 12-20-2008 12:55

Re: Not display msg of change name
 
Is not the best way, but try it...you can block the text message
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

public client_infochanged(id)
{
    new 
newname[32],oldname[32];
    
get_user_info(id,"name",newnamesizeof newname 1);
    
get_user_name(id,oldname,sizeof oldname 1);
    
    if(!
equal(newname,oldname))
    {
        
set_user_infoid"name",newname );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;



Exolent[jNr] 12-20-2008 13:32

Re: Not display msg of change name
 
Code:
public plugin_init() {     register_message(get_user_msgid("SayText"), "MessageNameChange"); } public MessageNameChange(msgid, dest, receiver) {     static info[64];     get_msg_arg_string(2, info, sizeof(info) - 1);         if( !equali(info, "#Cstrike_Name_Change") ) return PLUGIN_CONTINUE;         // If you want to block any message being shown (not player specific):     return PLUGIN_HANDLED;         // If you want to block the message when a specific player changes name     static client;         for( new i = 3; i < 5; i++ )     {         get_msg_arg_string(i, info, sizeof(info) - 1);         client = get_user_index(info);                 if( is_user_connected(client) ) break;                 client = 0;     }         return (client && /* block name change for 'client' */) ? PLUGIN_HANDLED : PLUGIN_CONTINUE; }

Starsailor 12-20-2008 14:04

Re: Not display msg of change name
 
exolent you are very inteligent :)

anakin_cstrike 12-20-2008 14:47

Re: Not display msg of change name
 
Quote:

Originally Posted by Exolent[jNr] (Post 730436)
Code:
public plugin_init() { register_message(get_user_msgid("SayText"), "MessageNameChange"); } public MessageNameChange(msgid, dest, receiver) { static info[64]; get_msg_arg_string(2, info, sizeof(info) - 1); if( !equali(info, "#Cstrike_Name_Change") ) return PLUGIN_CONTINUE; // If you want to block any message being shown (not player specific): return PLUGIN_HANDLED; // If you want to block the message when a specific player changes name static client; for( new i = 3; i < 5; i++ ) { get_msg_arg_string(i, info, sizeof(info) - 1); client = get_user_index(info); if( is_user_connected(client) ) break; client = 0; } return (client && /* block name change for 'client' */) ? PLUGIN_HANDLED : PLUGIN_CONTINUE; }

I thought so but i didn't know the "#Cstrike_Name_Change" part

SchlumPF* 12-20-2008 14:49

Re: Not display msg of change name
 
i tested saytext too but cuz of some mysterious reasons saytext is fired on my listenserver without string2+string3 like the wiki says. string1 holds the formated string :/

L// 12-20-2008 18:01

Re: Not display msg of change name
 
thank Exolent. +k :wink:


All times are GMT -4. The time now is 09:10.

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