14.05.2014, 13:22
Come on dude have some patience!
No. Because, for example, 11 (0x11) in the hexadecimal number system is 17 in the decimal number system.
Pro tip: use the Programmer's mode in Windows Calculator to help you with hexadecimal operations.
Quote:
I am pretty sure that the "x" specifier also handles normal numbers, making the job more easier! Correct me if I am wrong. Cheers (source?)
|
pawn Код:
CMD:color(playerid, params[])
{
new color;
if(sscanf(params, "x", color))
return SendClientMessage(playerid, -1, "Invalid input");
color <<= 8; // shift left to make room for alpha
color |= 0xFF; // Add the alpha
SetPlayerColor(playerid, color);
return 1;
}