Sign in to follow this  
Sh3llK0de

Players With Unicode Names

Recommended Posts

Hi all,

Was wondering if there is a way that I could replace players' name that has unicode characters in it. I know that renaming a person through client dvars now only works if they reconnect. I was wondering if there was some sort of setting to have the players with unicode names have the names changed like it used to, like the names would change to something like CID1.

 

Thanks in advance for any assistance.

Share this post


Link to post
Share on other sites
On 8/18/2021 at 8:32 PM, Fraggy said:

Update to it:

On server scripts you can use now:

playerentity.name = „Newname“;

playerentity.isBot is now set by the server to the proper readonly value. If you have mods/scripts setting this field, then comment the error creating line of code out.

 

Share this post


Link to post
Share on other sites

Ah great, thank you!

Also, I'm not very knowledgeable with unicode in C++. Is there some sort of built in function or way to find out if a player's name is not UTF8?

for example, if were to do something like the following, would it work?

 

if(!isstring(playerentity.name))
  playerentity.name = "CID" + playerentity getUID();

 

Edited by Sh3llK0de

Share this post


Link to post
Share on other sites

I found a solution to my issue. Just posting in the event it can help someone else.

My issue was B3 would not recognize unicode names and end up with errors if a tempban/ban was issued to that player. When the player had unicode name, B3 would see their name as an empty string ("").

My solution was to create a tiny plugin for B3 that checked for that empty string name when a player connects and send over a signal to the server to change the name. My function to handle the name change is as follows:

asciirenamer() {
	player = getentbynum(getDvarInt("b3_asciirename"));
	setDvar("b3_asciirename", "");
	if(isDefined(player)) {
		playeruid = player getUID();
		oldname = player.name;
		player.name = "CID" + inttostr(playeruid);
		iprintLn(oldname  + " was renamed to " player.name);
	}
}

Hope it helps. Thanks again to leiizko for the helpful response.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this