public IsAllowName(id)
{
new name[32];
get_user_info(id, "name", name, charsmax(name));
for (new i = 0; i < sizeof(name); i++)
{
if (name[i] < 20 || name[i] > 127)
return 0;
}
return 1;
}
public check_user_name(id)
{
if (!IsAllowName(id))
server_cmd("kick #%d ^"你的名字不合法,名字中不能包含中文。^"", get_user_userid(id));
}
public client_connect(id)
check_user_name(id);
public client_infochanged(id)
check_user_name(id);
|