View Single Post
Author Message
Snake.
Senior Member
Join Date: Jul 2017
Old 05-07-2020 , 09:36   Plugin does not read the end of the line
Reply With Quote #1

Plugin does not see the ones coming after '/' How to fix it ?
PHP Code:
 case '0'..'9''A'..'Z''a'..'z''$''?''('')''=''['']''{''}''*''-''_''>''<''|''!''&''+''%'':''/''.'','';''#'// Add characters to the list here. 

PHP Code:
#include <amxmodx>

#define PLUGIN        "No-Spl Chars InName"
#define VERSION        "1.0"
#define AUTHOR        "Shooting King"


public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );
}

public 
client_putinserver(idCheckName(idtrue);

public 
client_infochanged(idCheckName(idfalse);

public 
CheckNameidbool:bShowMsg )
{
    static 
ijszName[33], szNewName[33], len;
    
    
len 0;
    
szName[0] = '^0';
    
szNewName[0] = '^0';
    
    
get_user_info(id"name"szName33);
    
len strlen(szName);
    
// log_amx( "Checking.... %s[%d] ", szName, len );
    
 
for( 0leni++ )
    {
        switch( 
szName[i] )
        {
            case 
'0'..'9''A'..'Z''a'..'z''$''?''('')''=''['']''{''}''*''-''_''>''<''|''!''&''+''%'':''/''.'','';''#'// Add characters to the list here.
            
{
                
// log_amx( "a Valid Char.... %c[%d] ", szName[i], i );
                
szNewName[j++] = szName[i];
            }
        }
    }  

    if( 
33 szNewName[j] = '^0';    
    
set_user_info(id,"name",szNewName); 
    
    
/*if( bShowMsg )
    {
        client_print( 0, print_chat, "Player with original nickname ^"%s^"[%s] joined the game.", szName, szNewName );
    }*/

Snake. is offline
Send a message via Skype™ to Snake.