AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Plugin does not read the end of the line (https://forums.alliedmods.net/showthread.php?t=324137)

Snake. 05-07-2020 09:36

Plugin does not read the end of the line
 
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 );
    }*/



Napoleon_be 05-07-2020 10:55

Re: Plugin does not read the end of the line
 
try placing it at the end of the line and check if it's still happening.

+ARUKARI- 05-07-2020 11:26

Re: Plugin does not read the end of the line
 
Is this help?

PHP Code:

    new const AsciiCodes[][] =
    {
        { 
3364 },     // ! " # $ % & ' ( ) * + , - . / 0 - 9 : ; < = > ? @
        
97122 },    // a - z
        
6590 }      // A - Z
    
}; 


Snake. 05-07-2020 11:40

Re: Plugin does not read the end of the line
 
Quote:

Originally Posted by Napoleon_be (Post 2698684)
try placing it at the end of the line and check if it's still happening.

I could not understand what u mean. The last 3 character ( ',' ';' '#' ) in the line can't be read.

Snake. 05-07-2020 11:46

Re: Plugin does not read the end of the line
 
Quote:

Originally Posted by +ARUKARI- (Post 2698692)
Is this help?

PHP Code:

    new const AsciiCodes[][] =
    {
        { 
3364 },     // ! " # $ % & ' ( ) * + , - . / 0 - 9 : ; < = > ? @
        
97122 },    // a - z
        
6590 }      // A - Z
    
}; 


I am not sure how to do that.

+ARUKARI- 05-07-2020 12:14

Re: Plugin does not read the end of the line
 
Quote:

Originally Posted by Snake. (Post 2698697)
I am not sure how to do that.

PHP Code:

case 33..9097..122



All times are GMT -4. The time now is 13:00.

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