24.11.2011, 17:10
Hello All,
Today, I want to make a ban system with time and range ban.
I want to separate the numbers to compare in the banlist with numbers or * for each part of the IP.
Example: ip=199.188.177.166
==> ip1="199"; ip2="188"; ip3="177"; ip4="166";
But, with this script, I have:
ip1="199"; ip2="188177166"; ip3="177166"; ip4="166";
it's strange, I don't understand the function split
What's the solution ?
thank you in advance
(sorry for my bad english)
Today, I want to make a ban system with time and range ban.
I want to separate the numbers to compare in the banlist with numbers or * for each part of the IP.
Example: ip=199.188.177.166
==> ip1="199"; ip2="188"; ip3="177"; ip4="166";
Код:
new jip[16], cip[4][3]; GetPlayerIp(playerid, jip, sizeof(jip)); split(jip, cip, '.');
ip1="199"; ip2="188177166"; ip3="177166"; ip4="166";
it's strange, I don't understand the function split
Quote:
split(const strsrc[], strdest[][], delimiter) { new i, li; new aNum; new len; while(i <= strlen(strsrc)){ if(strsrc[i]==delimiter || i==strlen(strsrc)){ len = strmid(strdest[aNum], strsrc, li, i, 12 ![]() strdest[aNum][len] = 0; li = i+1; aNum++; } i++; } return 1; } |
thank you in advance
