Raised This Month: $ Target: $400
 0% 

Block name change create sz_Getspace: overflow


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-25-2011 , 13:37   Block name change create sz_Getspace: overflow
Reply With Quote #1

Hello. Here is my partial code:

PHP Code:
register_forwardFM_ClientUserInfoChanged"Fm_ClientUserInfoChangedPre" )

[...]

public 
client_putinserverid )
{
    
get_user_nameidg_szNamecharsmaxg_szName[ ] ) )
}

public 
Fm_ClientUserInfoChangedPreidszInfo )
{
    if( !
IsConnectedid ) )
        return 
FMRES_IGNORED
    
    
static szNewname32 ]
    
engfuncEngFunc_InfoKeyValueszInfo"name"szNewnamecharsmaxszNewname ) )
    
    if( 
equalszNewnameg_szNameid ] ) )
        return 
FMRES_IGNORED
    
    engfunc
EngFunc_SetClientKeyValueidszInfo"name"g_szNameid ] )
    
client_cmdid"name ^"%s^";setinfo name ^"%s^""g_szNameid ], g_szNameid ] )
    
    
ColorChatid"Change name restrict on this server!" )
    
    return 
FMRES_SUPERCEDE

Also I use galileo plugin from map changes, and where galileo start the map change (countdown) and player connected in the that moment will receive the 'overflow' message.

Any suggestions will welcome.
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-25-2011 , 13:43   Re: Block name change create sz_Getspace: overflow
Reply With Quote #2

Any reason you use fakemeta instead of client_userinfochanged, get_user_info and set_user_info ?

Also, you have to change :

get_user_name( id, g_szName, charsmax( g_szName[ ] ) )

with

get_user_name( id, g_szName[id], charsmax( g_szName[ ] ) )
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-25-2011 , 14:05   Re: Block name change create sz_Getspace: overflow
Reply With Quote #3

Ok, tried without fakemeta:

PHP Code:
#include < amxmodx >

public client_infochangedid )
{
    if( !
is_user_connectedid ) )
        return 
PLUGIN_CONTINUE
        
    
static szNewName32 ]
    
get_user_infoid"name"szNewNamecharsmaxszNewName ) )
    
    static 
szName32 ]
    
get_user_nameidszNamecharsmaxszName ) )
    
    if( 
equalszNewNameszName ) == -)
        return 
PLUGIN_CONTINUE
        
    set_user_info
id"name"szName )
    
    
client_printid3"Change name restrict on this server!" )
    
    return 
PLUGIN_HANDLED

name blocked, but not properly (see image)


And, after first spawn I received message: "Change name restrict on this server!"
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-25-2011 , 14:25   Re: Block name change create sz_Getspace: overflow
Reply With Quote #4

Try :

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("Block Name"VERSION"ConnorMcLeod");

    
register_forward(FM_SetClientKeyValue"SetClientKeyValue");
}

public 
SetClientKeyValue(id, const szInfoBuffer[], const szKey[]/*, const szValue[]*/)
{
    if( 
is_user_connected(id) && equal(szKey"name") )
    {
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-25-2011 , 14:30   Re: Block name change create sz_Getspace: overflow
Reply With Quote #5

Nope, not blocked.

Edit:

Here is worked version:
PHP Code:
#include < amxmodx >

public plugin_init()
{
    
register_messageget_user_msgid"SayText" ) , "Message_SayText" )
    
    
register_clcmd"test""test" )
}

public 
testid )
{
    new 
szName32 ]
    
get_user_nameidszNamecharsmaxszName ) )

    
console_printid"Name: %s"szName )
}

public 
client_infochangedid )
{
    if( !
is_user_connectedid ) )
        return 
PLUGIN_CONTINUE
        
    
static szNewName32 ]
    
get_user_infoid"name"szNewNamecharsmaxszNewName ) )
    
    static 
szName32 ]
    
get_user_nameidszNamecharsmaxszName ) )
    
    if( !
equalszNewNameszName ) )
    {    
        
set_user_infoid"name"szName )
    
        
client_printid3"Change name restrict on this server!" )
    
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE
}

public 
Message_SayTextiMsgIdiMsgDestid )
{
    static 
szMsg64 ]
    
get_msg_arg_string2szMsgcharsmaxszMsg ) )
    
    if( 
equalszMsg"#Cstrike_Name_Change" ) != -|| equalszMsg"#Name_change_at_respawn" ) != -)
        return 
PLUGIN_HANDLED
        
    
return PLUGIN_CONTINUE

Not best method, but worked during the test on server.

Last edited by dFF; 07-25-2011 at 14:39.
dFF is offline
Old 10-30-2013, 13:55
BLANCIKJOINT_
This message has been deleted by YamiKaitou. Reason: slowhacking + spam
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 18:00.


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