30.05.2017, 17:13
I've got word-wrapping system on my server that uses strlen, but for example taking this short text from SA-MP forum
SendClientMessage(playerid, COLOR_WHITE, "Welcome to {00FF00}M{FFFFFF}a{FF0000}r{FFFFFF}c{00FF00}o{FFFF FF}'{FF0000}s {FFFFFF}B{00FF00}i{FFFFFF}s{FF0000}t{FFFFFF}r{00FF 00}o{FFFFFF}!");
It would make the "Welcome to Marco's Bistro" look like "Welcome to Mar...(new line)...Co's Bistro" because strlen takes colorcodes into consideration. Let's see i make 2nd variable and want to store the text without colorcodes in it, how would I remove them?
SendClientMessage(playerid, COLOR_WHITE, "Welcome to {00FF00}M{FFFFFF}a{FF0000}r{FFFFFF}c{00FF00}o{FFFF FF}'{FF0000}s {FFFFFF}B{00FF00}i{FFFFFF}s{FF0000}t{FFFFFF}r{00FF 00}o{FFFFFF}!");
It would make the "Welcome to Marco's Bistro" look like "Welcome to Mar...(new line)...Co's Bistro" because strlen takes colorcodes into consideration. Let's see i make 2nd variable and want to store the text without colorcodes in it, how would I remove them?