Jump to content

Problem with setPlayerName


Spakye

Recommended Posts

Hello, im working on a clan system wich let you choose a clan tag that includes color codes.

When a player logs in it should change his name to add his clan tag. Though the function setPlayerName only allows 22 characters and color codes makes it longer.

This is the string i want to have as my nickname : #344F25TM#0C1109|#23331BSpakye  once you remove the color code it should be TM|Spakye with some colors.

Is there a way to bypass this limit of 22 characters ?

 

Link to comment

This will change the whole nick to a specific color, i wish people to be able to fully customize the clan tag with few colors.

I guess a solution is to edit the scoreboard for it to show clantag..nickname and also to modify the chat so when people writte a message it will show clantag..nickname.. ": "..themessage but maybe there is an easier solution.

Right now the way it works is they pick a tag limitation such as [ ] or |, a color for this limitation,  a tag wich can include color codes, and finally a color for the player name and blip.

So it look like this if the limitation is one char long : tag with color codes .. limitation color .. limitation .. player color .. player name  wich gives TM|Spakye

and with  2 char limitation : limitation color .. limitation .. tag with color codes .. limitation color .. limitation .. player color .. player name wich gives [TM]Spakye

I dont think im explaining it very well, my english isnt great.

Spoiler

mta-screen-2020-11-01-21-41-57.png

Spoiler

mta-screen-2020-11-01-21-41-36.png

 

Edited by Spakye
edit to add pictures
Link to comment
19 minutes ago, DNL291 said:

You can also use a custom function for that, like a exported function or storing the custom name with setElementData and setAccountData to save permanently.
You can't bypass the character limit of setPlayerName.

ok to store it but then what would you do ?

Something like keep the nickname simple (in my case spakye), then modify the scoreboard for it to add the clantag before the nickname and do the same thing when people send a message in the chat ?

Is it what you had in mind?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...