Raised This Month: $ Target: $400
 0% 

name blocking, changing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
m0v3
Member
Join Date: May 2009
Old 11-20-2010 , 20:18   name blocking, changing
Reply With Quote #1

Hi,

I have this function , using which you can change player name to the one you want , also blocking name changing for players. It works also for dead people , what is pretty handy for me, but causes server lags , chokes , sometimes (not always ) even svc_bad's. Is there a better solution for the aim I want, or can my function be optimised in any ways? Thank You.

Working, but still laggy solution:
PHP Code:
public plugin_init() {
    
    
register_plugin("test","0.1","m0v3")
    
    
register_forward(FM_ClientUserInfoChanged"forward_client_userinfochanged"
}

public 
forward_client_userinfochanged(idbuffer) {

    if ( !
IsConnected[id] )
        return 
FMRES_IGNORED
        
    
static val[32];
    static 
name[33];
    static 
neimas[36];
   
formatex(neimascharsmax(neimas), "[%03i].%s"SKILLplayer_name[id])
    
get_user_name(idnamecharsmax(name))
    
    
engfunc(EngFunc_InfoKeyValuebuffer"name"valsizeof val 1);
    
    if ( 
equal(name neimas) && equal(val neimas) )
        return 
FMRES_IGNORED
        

    engfunc
(EngFunc_SetClientKeyValueidbuffer"name"neimas);
   
    
engclient_cmdid "name ^"%s^"" player_name[id] );

    return 
FMRES_SUPERCEDE


Last edited by m0v3; 11-22-2010 at 04:54.
m0v3 is offline
 



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:20.


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