Senior Member
|
05-07-2020
, 09:36
Plugin does not read the end of the line
|
#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_plugin( PLUGIN, VERSION, AUTHOR );
}
public client_putinserver(id) CheckName(id, true);
public client_infochanged(id) CheckName(id, false);
public CheckName( id, bool:bShowMsg )
{
static i, j, szName[33], szNewName[33], len;
i = j = len = 0;
szName[0] = '^0';
szNewName[0] = '^0';
get_user_info(id, "name", szName, 33);
len = strlen(szName);
// log_amx( "Checking.... %s[%d] ", szName, len );
for( i = 0; i < len; i++ )
{
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( j < 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 );
}*/
}
|
|