28.06.2017, 05:29
Quote:
Hi there,
I've been trying to make a range ban command where it automatically removes the last few digits from the IP and ban it, but I've been stuck at how can I remove the last few digits. I've designed a code from what I've got in my brain. Current code: PHP код:
PHP код:
|
PHP код:
GetPlayerIp(player1, ip, sizeof ip)
new len = strlen(ip),i,count;
for(i=len;count!=2;--i)
{
if(ip[i] == '.') ++count;
}
strdel(ip,++i,len);