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;
}
if(dialogid == DIALOG_COR)
{
if(response >= 0)
{
SetPlayerColor(playerid, StrToHex(inputtext));
}
return 1;
}