12.01.2014, 19:37
Was just playing with PAWN this evening and came out wit this, using strreplace you could use Gametext Colours in SendClientMessage and any function that uses HTML color codes.
pawn Код:
#include <a_samp>
#include <strlib> //by Slice, not Westie
main()
{
new
formatStr[184];
formatStr = "~r~ Red\n";
strcat(formatStr, "~g~ Green\n"), strcat(formatStr, "~b~ Blue\n"),
strcat(formatStr, "~w~ White\n"), strcat(formatStr, "~y~ Yellow\n"),
strcat(formatStr, "~p~ Purple\n"), strcat(formatStr, "~bl~ Black\n"),
strcat(formatStr, "~c~ Cyan\n"), strcat(formatStr, "~o~ Orange\n"),
strcat(formatStr, "~pk~ Pink\n"), strcat(formatStr, "~lb~ Light Blue\n"),
strcat(formatStr, "~br~ Brown\n"), UseGameTextColours(formatStr, sizeof(formatStr));
print(formatStr);
}
stock UseGameTextColours( string[], size = sizeof(string) )
{
strreplace(string, "~r~", "{f90303}", false, 0, -1, size); //red
strreplace(string, "~g~", "{03f90a}", false, 0, -1, size); //green
strreplace(string, "~b~", "{030af9}", false, 0, -1, size); //blue
strreplace(string, "~w~", "{ffffff}", false, 0, -1, size); //white
strreplace(string, "~y~", "{f0ff00}", false, 0, -1, size); //yellow
strreplace(string, "~p~", "{8000ff}", false, 0, -1, size); //purple
strreplace(string, "~bl~", "{000000}", false, 0, -1, size); //black
strreplace(string, "~c~", "{00FFFF}", false, 0, -1, size); //cyan
strreplace(string, "~o~", "{FF9900}", false, 0, -1, size); //orange
strreplace(string, "~pk~", "{FF3399}", false, 0, -1, size); //pink
strreplace(string, "~lb~", "{66CCFF}", false, 0, -1, size); //lightblue
strreplace(string, "~br~", "{CC6600}", false, 0, -1, size); //brown
//just follow the format above if you want to add colour, just playing with pawn :D
}
pawn Код:
{f90303} Red
{03f90a} Green
{030af9} Blue
{ffffff} White
{f0ff00} Yellow
{8000ff} Purple
{000000} Black
{00FFFF} Cyan
{FF9900} Orange
{FF3399} Pink
{66CCFF} Light Blue
{CC6600} Brown