This plugin works good but there is a just problem.
While player connects, his name changes (characters are replaced to ' ')
But player should retry for name.
Example;
Code:
óÖğreónció connected to server.
Console command (name re nci) [deleted óÖğ chars]
Name is "óÖğrenció"
retry
re nci connected to server
name is "re nci"
I want to make 2 things. Replace null instead of space. '' not ' '
And change his name with no need retry.
PHP Code:
#include <amxmodx>
public plugin_init() {
register_plugin("Block Characters", "1.0", "PurposeLess");
}
public client_connect(id)
{
new name[32];
get_user_name(id, name, charsmax(name));
new bool:found = false;
for( new i; i < charsmax(name); i++ )
{
if(isalpha(name[i]))
{
continue;
}
if(name[i] < 32 || name[i] > 126)
{
//replace_all(name[i], charsmax(name) - i, name[i], "");
//replace_all(name, charsmax(name), name[i], "");
name[i] = ' ';
found = true;
continue;
}
}
if(found)
{
client_cmd(id, "name ^"%s^"", name);
}
}
__________________