25.11.2014, 13:01
IP is (generally) a string, and must be handled as such. Not every sequence of numbers with dots is classified as a number. If you want to save the IP as a number (e.g. for easier use of the BETWEEN clause) then you can do so by using INET_ATON() and INET_NTOA().
Pawn implementation:
Pawn implementation:
pawn Код:
inet_aton(ip[])
{
new parts[4];
sscanf(ip, "p<.>a<i>[4]", parts);
return (parts[3] << 24 | parts[2] << 16 | parts[1] << 8 | parts[0]);
}