txAdmin icon indicating copy to clipboard operation
txAdmin copied to clipboard

fix(menu) Fix playernames with invalid chars in name

Open Misha0717 opened this issue 6 months ago • 2 comments

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

Misha0717 avatar Jun 28 '25 21:06 Misha0717

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.

tabarra avatar Jun 28 '25 21:06 tabarra

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.

Misha0717 avatar Jun 29 '25 20:06 Misha0717