Skip to content

Conversation

@Misha0717
Copy link
Contributor

there are some chars when you have that in your name, the name will no longer be shown at all.
The pr will remove the invalid char.

Preview:
image

Player name:
image

there are some chars when you have that in your name, the name will no longer be shown at all.
@Misha0717 Misha0717 requested a review from tabarra as a code owner June 28, 2025 21:19
@tabarra
Copy link
Collaborator

tabarra commented Jun 28, 2025

What's the definition of %w? Sounds a bit vague and not friendly towards scripts that are not alphabetic (Thai, Farsi, Cyrillic, Chinese, etc.).
Ideally we should use the txAdmin cleanPlayerNames() to get the name to be displayed, but the best implementation would be for Cfx to implement a UpdatePlayerName(tempNetId: number, name: string) that could be called by txAdmin at the handling of playerConnecting(), as well as allow other resources to set the player's rank, RP name, etc.

@Misha0717
Copy link
Contributor Author

I have tested it with chinese chars, and as you told unfortunately it will remove also that kinda chars. The only thing to fix this is prob gsub specific chars like in the preview seen. Would be beter ofc if cfx fix this.

@tabarra tabarra marked this pull request as draft June 29, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants