17.02.2015, 22:27
Quote:
|
IsFloat(Float:number)
Useful to check if a number is a float or not. pawn Код:
|
And since I'm here I might as well post some more functions.
pawn Код:
stock inet_aton(ip[]) // converts a human readable IP into its native format
{
new parts[4];
sscanf(ip, "p<.>a<i>[4]", parts);
return (parts[0] << 24 | parts[1] << 16 | parts[2] << 8 | parts[3]);
}
pawn Код:
stock inet_ntoa(ipnum, str_return[], size = sizeof str_return) // not tested but ought to work
{
format(str_return, size, "%d.%d.%d.%d",
(ipnum & 0xFF000000) >>> 24,
(ipnum & 0x00FF0000) >>> 16,
(ipnum & 0x0000FF00) >>> 8,
(ipnum & 0x000000FF)
);
}


