18.04.2011, 07:47
Hi guys , I have spent a long time away from scripting , and Am having trouble getting my head back around to it..( arggh lol)
I am using this for anti advertise , its pretty old code
I am trying to make it so that there can be exception ips , but I am not 100% sure on what to do.
Does anyone any tips or code to help me?
Cheers guys & have a good day.
I am using this for anti advertise , its pretty old code
Код:
public OnFilterScriptInit() { print(" Anti Advertisment "); return 1; } public OnFilterScriptExit() return 1; public OnPlayerText(playerid, text[]) { if(FindIP(text)) return kick4IP(playerid, text); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(FindIP(cmdtext)) return kick4IP(playerid, cmdtext); return 0; } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //FUCTION FindIP(StrToChk[]) { new IpLevel = 0; for(new a = 0; a < strlen(StrToChk); a++) { switch(IpLevel) { case 0:{ if(IsNum(StrToChk[a])) IpLevel++; } case 1, 2:{ if(IsNum(StrToChk[a])) IpLevel++; else if(StrToChk[a] == '.') IpLevel = 4; else IpLevel = 0; } case 3:{ if(StrToChk[a] == '.') IpLevel++; else IpLevel = 0; } case 4:{ if(IsNum(StrToChk[a])) IpLevel++; else IpLevel = 0; } case 5, 6:{ if(IsNum(StrToChk[a])) IpLevel++; else if(StrToChk[a] == '.') IpLevel = 8; else IpLevel = 0; } case 7:{ if(StrToChk[a] == '.') IpLevel++; else IpLevel = 0; } case 8:{ if(IsNum(StrToChk[a])) IpLevel++; else IpLevel = 0; } case 9, 10:{ if(IsNum(StrToChk[a])) IpLevel++; else if(StrToChk[a] == '.') IpLevel = 12; else IpLevel = 0; } case 11:{ if(StrToChk[a] == '.') IpLevel++; else IpLevel = 0; } case 12:{ if(IsNum(StrToChk[a])) return 1; else IpLevel = 0; } } } return 0; } IsNum(textchar) { if(textchar == '0') return 1; if(textchar == '1') return 1; if(textchar == '2') return 1; if(textchar == '3') return 1; if(textchar == '4') return 1; if(textchar == '5') return 1; if(textchar == '6') return 1; if(textchar == '7') return 1; if(textchar == '8') return 1; if(textchar == '9') return 1; return 0; } //END OF FUNCTION
Does anyone any tips or code to help me?
Cheers guys & have a good day.