26.12.2011, 12:17
I want to write a function that changes 010 (10 in PAWN) to 8, 020 (20 in PAWN) to 16 etc.
stock GetOctal(value)
{
new newvalue = value/100*80;
return newvalue;
}
stock OctalValue(x)
{
new str[10], rn;
valstr(str, x);
for(new z, i = strlen(str) - 1; i >= 0; i--, z++)
rn += (str[i] - '0') * floatround(floatpower(8.0, z));
return rn;
}