Posts: 1,659
Threads: 17
Joined: Sep 2008
Use search.
Quote:
Originally Posted by paulor
pawn Код:
StrToHex(string[]) //By. DOS { new i, value; if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X')) i = 2;
while (string[i]) { value <<= 4; switch (string[i]) { case '0' .. '9': value |= string[i] - '0';
case 'A' .. 'F': value |= string[i] - 'A' + 10;
case 'a' .. 'f': value |= string[i] - 'a' + 10;
default: return 0; } ++i; } return value; }
|
Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
CMD:mycolor(playerid, params[])
{
if(sscanf(params,"x",params[0])) SendClientMessage(playerid, -1, "USAGE: {49FFFF}/mycolor { HEX }");
else{
new str[12];
params[0] = (params[0] * 256) + 0xAA;
SetPlayerColor(playerid, params[0]);
format(str,sizeof(str),"0x%06xAA", (params[0] >>> 8));
SendClientMessage(playerid,-1,str);
}
return 1;
}