26.05.2018, 03:07
Rather than storing the color as an rgb value, and trying to insert it into the text as hex, simply make the color value, a setting, an integer, so it goes 1 2 3 4 - 2174664 and you simply use those settings to check which color to format within a case statement.
If you then expand the system more, you could make a function to make that preformat the line so it doesn't need to be done a whole heap of times in the script itself.
In the current scenario of 4 colors, you'd only have it check on the OnPlayerText callback, but if you added more features, such as a car material text that used the same formatting, or a 3dtext, or something other than the onplayertext then you'd look at a function.
Probably to cut the error, all you'd need to do is make color[7], but as I've been mentioning, it's not such a good idea unless you are doing custom colors via RGB selection/text entry.
I also edit a lot, so re-read and refresh what I've put up.
ANNNNNDDD, a real good mess about to check out new methods, is to use a fresh new.pwn, and put the basics of what you need, in there, and see what you can produce.
If you then expand the system more, you could make a function to make that preformat the line so it doesn't need to be done a whole heap of times in the script itself.
In the current scenario of 4 colors, you'd only have it check on the OnPlayerText callback, but if you added more features, such as a car material text that used the same formatting, or a 3dtext, or something other than the onplayertext then you'd look at a function.
Probably to cut the error, all you'd need to do is make color[7], but as I've been mentioning, it's not such a good idea unless you are doing custom colors via RGB selection/text entry.
I also edit a lot, so re-read and refresh what I've put up.
ANNNNNDDD, a real good mess about to check out new methods, is to use a fresh new.pwn, and put the basics of what you need, in there, and see what you can produce.