Raised This Month: $ Target: $400
 0% 

client_infochanged


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-30-2009 , 21:05   client_infochanged
Reply With Quote #1

IN ALL CODES:
PHP Code:
public setcvar()
{
    
set_cvar_string("changenick_allow","0")

CODES:

PHP Code:
public client_infochanged(id)
{
    new 
newname[32],oldname[32]
    
get_user_info(id"name"newname,31)
    
get_user_name(id,oldname,31)
    new 
vt[3]
    
get_cvar_string("changenick_allow",vt,2);
    if (!
equal(oldname,newname)) 
    {
       if (
vt[1] == 0)
       {
            
set_cvar_string("changenick_allow","1")
            
get_user_name(id,oldname,31)
            
client_print(idprint_chat"[Gather] -> Prv: You may not change your nick, Your nick is again: %s"oldname);
            
client_cmd(id,"name %s",oldname)
            
set_task(0.6,"setcvar");
            return 
PLUGIN_HANDLED
       
}
       return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED 

PHP Code:
new reqname[32]
public 
client_infochanged(id)
{
    new 
newname[32],oldname[32]
    
get_user_info(id"name"newname,31)
    
get_user_name(id,oldname,31)
    if (
equal(reqname,oldname))
    {
       return 
PLUGIN_HANDLED;
    }
    
get_user_name(id,oldname,31)
    
reqname=oldname;
    
client_print(idprint_chat"[Gather] -> Prv: You may not change your nick, Your nick is again: %s"oldname);
    
client_cmd(id,"name %s",oldname);
    return 
PLUGIN_HANDLED 

PHP Code:
public client_infochanged(id)
{
    new 
newname[32],oldname[32]
    
get_user_info(id"name"newname,31)
    
get_user_name(id,oldname,31)
    if (!
equal(oldname,newname)) 
    {
       if (
get_cvar_num("changenick_allow") == 0)
       {
            
set_cvar_string("changenick_allow","1")
            
get_user_name(id,oldname,31)
            
client_print(idprint_chat"[Gather] -> Prv: You may not change your nick, Your nick is again: %s"oldname);
            
client_cmd(id,"name %s",oldname)
            
set_task(0.6,"setcvar");
            return 
PLUGIN_HANDLED
       
}
       return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED 

Both Codes are wrong, i want a code that it makes players to do not change their name...
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2009 , 21:08   Re: client_infochanged
Reply With Quote #2

It can be done with Fakemeta:

PHP Code:
register_forward(FM_ClientUserInfoChanged"function"
__________________
fysiks is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-30-2009 , 21:09   Re: client_infochanged
Reply With Quote #3

The way is that i don't know how to block a user change name..
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2009 , 21:26   Re: client_infochanged
Reply With Quote #4

You can try this.

PHP Code:

    register_forward
(FM_ClientUserInfoChanged"fwClientUserInfoChanged")
// ...

public fwClientUserInfoChanged(idbuffer)
{
    if( 
is_user_connected(id) )
    {
        static 
name[32]
        static 
val[32]
        
get_user_name(idname31)
        
engfunc(EngFunc_InfoKeyValuebuffer"name"val31)
        if (
equal(valname))
            return 
FMRES_IGNORED

        engfunc
(EngFunc_SetClientKeyValueidbuffer"name"name)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

__________________

Last edited by fysiks; 12-31-2009 at 19:29.
fysiks is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 12-31-2009 , 06:05   Re: client_infochanged
Reply With Quote #5

L 12/31/2009 - 13:03:51: "GaMeMaStEr<55><STEAM_0:1:20434070><>" connected, address "127.0.0.1:27005"
L 12/31/2009 - 13:03:52: "<55><STEAM_0:1:20434070><>" STEAM USERID validated

When i connect it changes my name,, i don't want when i connect, i want when i CHANGE my name..
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-31-2009 , 19:27   Re: client_infochanged
Reply With Quote #6

Ok, try it now.
__________________

Last edited by fysiks; 12-31-2009 at 19:29.
fysiks is offline
Reply



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 04:08.


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