29.01.2014, 15:39
Was wondering how I would go about this in PAWN.
stock GetFirstNumber(number)
{
new
number_str[12],
bool: negative;
valstr(number_str, number);
if (number < 0) negative = true;
return (negative) ? (number_str[1]) : (number_str[0]);
}
printf("%c", GetFirstNumber(654321));
printf("%c", GetFirstNumber(-54321));
6
5