[LUA] Getting color of every character in string

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Hello! I am making a mod, and part of it includes the player's name. Players on this server have clans, thus have clan tags. Typing [/id <id>] you get this (click). How can I get just the name of the player from this string? I think I could get the name and clan tag altogether from that string, but how can I remove the clan tag? I only want to get the player's name from that string (in this case, it being "Kristler").

**Bare in mind, the clan tag can be before or after the player's name, and there are different clan tags.
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Convert it
The only issue with this is that i dont know what the clan tag is. I cant just write every single clan tag from the server and always update it when a clan is registered/deleted. The only possible way (as far as i thought), is to get the colour from the chat of the clan tag, and remove that from the name (if you look at the screenshot that i attached, the clan tag is a yellow-ish colour). What I basically want is to get every single colour from the chat (how it is put in chatlog.txt). In ur chatlog you are formatted every coloured and text on every line, thats what i need.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
The only issue with this is that i dont know what the clan tag is. I cant just write every single clan tag from the server and always update it when a clan is registered/deleted. The only possible way (as far as i thought), is to get the colour from the chat of the clan tag, and remove that from the name (if you look at the screenshot that i attached, the clan tag is a yellow-ish colour). What I basically want is to get every single colour from the chat (how it is put in chatlog.txt). In ur chatlog you are formatted every coloured and text on every line, thats what i need.
Then use this


Check for char ids here
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Then use this


Check for char ids here
In my case i want the exact opposite:
I want from 12345678 to {FFFFFF}123456{AA2B5C}78
 
Top