Converting colors from 'normal' to embed
#7

Wrote my own function.

pawn Код:
stock ColorToEmbed(const color[]) {
    new finalclr[7];
    format(finalclr, sizeof finalclr, "%s", color[2]);
    return finalclr;
}

CMD:embed(playerid, params) {
    new str[128], col[7];
    col = ColorToEmbed("0xFFFFFFFF");
    format(str, sizeof str, "Hi {%s}there.", col);
    SendClientMessage(playerid, 0xFF0000FF, str);
    return 1;
}
You need to input your color as a string into ColorToEmbed and it will return a color string without 0x and the last 2 characters. Works like charm.
Reply


Messages In This Thread
Converting colors from 'normal' to embed - by Mean - 27.08.2013, 23:36
Re : Converting colors from 'normal' to embed - by Matnix - 27.08.2013, 23:40
Re: Converting colors from 'normal' to embed - by Vule. - 27.08.2013, 23:41
Re: Converting colors from 'normal' to embed - by Luis- - 27.08.2013, 23:51
Re: Converting colors from 'normal' to embed - by Mean - 27.08.2013, 23:54
Re: Converting colors from 'normal' to embed - by Luis- - 28.08.2013, 00:01
Re: Converting colors from 'normal' to embed - by Mean - 28.08.2013, 00:45
Re: Converting colors from 'normal' to embed - by Luis- - 28.08.2013, 02:25
Re: Converting colors from 'normal' to embed - by Squash - 28.08.2013, 03:48
Re: Converting colors from 'normal' to embed - by Vince - 28.08.2013, 07:46

Forum Jump:


Users browsing this thread: 2 Guest(s)