Siema, pobra?em taki skrypt ale niestety nie dzia?a. wszystkie przekle?stwa s? w pliku w scriptfiles. Ale da si? skomplikowa? i wrzuci? na serwer, ale nie dzia?a.
Je?li kto? wie jak prosz? aby jeszcze by?o co? takiego, ?e jak kto? przeklnie to si? napisze: " Kocham Head Admina steo " <<< tak ?eby mu przypa? zrobi? troch? ;]
public OnFilterScriptInit()
{
print(" *** Anti spam by Combat Loaded ***");
print(" *** Anti Swear by Combat Loaded ***");
print(" *** Anti flood by Combat Loaded ***");
print(" *** Anti ad by Combat Loaded ***");
print(" *** Anti bot by Combat Loaded ***");
public OnPlayerConnect(playerid)
{
new playerip[18];
GetPlayerIp(playerid, playerip, sizeof playerip);
if(GetTickCount() - lasttimer < 220)
{
if(strcmp(playerip, lastip, true) == 0)
{
BanEx(playerid, "Takie samo IP podczas po??czenia ostatniego gracza w ci?gu 220 ms");
BanEx(lastplayer, "Takie samo IP podczas po??czenia ostatniego gracza w ci?gu 220 ms");
return 1;
}
}
public OnPlayerText(playerid, text[])
{
if(FindIP(text))
{
SCM(playerid, 0x800000C8, "[Ochrona Serwera] Nie reklamuj ip serwer?w na czacie");
return 0;
}
FindIP(StrToChk[])
{
new IpLevel = 0; //starting at level 0 we will search for a number in the string
for(new a = 0; a < strlen(StrToChk); a++) {//looking all the character one by one
switch(IpLevel)//i use a switch to process each IpLevel
{
case 0:{//First char of an IP, Searching for a number Exclusively
if(IsNum(StrToChk[a])) IpLevel++; //Number was found, NEXT LEVEL
//if no number found, we stay at level 0 looking for a number in the
// next character of the string.
}
case 1, 2:{ //We found 1 number NOW looking for a number OR a .
if(IsNum(StrToChk[a])) IpLevel++; //Number was found, NEXT LEVEL
else if(StrToChk[a] == '.') IpLevel = 4;//We found the first .
else IpLevel = 0; //The number is not follow by a number or a .
}
case 3:{ //We found 3 number, WE NEED a . or its not an IP
if(StrToChk[a] == '.') IpLevel++; // We found the . Next level!
else IpLevel = 0; //it was not a . we keep looking
}
case 4:{ //We found numbers and first . WE NEED a number or not an IP
if(IsNum(StrToChk[a])) IpLevel++; //Number was found, NEXT LEVEL
else IpLevel = 0; //did not find a number its NOT an IP we keep looking
}
case 5, 6:{ // [XXX.X] now looking for a number OR a .
if(IsNum(StrToChk[a])) IpLevel++; //Number was found, NEXT LEVEL
else if(StrToChk[a] == '.') IpLevel = 8;//We found the second .
else IpLevel = 0; //we found numbers but not follow by number or .
}
case 7:{ //[XXX.XXX] we NEED a . or its not an IP
if(StrToChk[a] == '.') IpLevel++; //We find a . NEXT level
else IpLevel = 0;//We did not find a . Not an IP we keep looking
}
case 8:{ //[XXX.XXX.] we NEED a Number or its not an IP
if(IsNum(StrToChk[a])) IpLevel++; //Number was found, NEXT LEVEL
else IpLevel = 0; //did not find a number its NOT an IP we keep looking
}
case 9, 10:{ //[XXX.XXX.X] looking for a number or a .
if(IsNum(StrToChk[a])) IpLevel++; //Number was found, NEXT LEVEL
else if(StrToChk[a] == '.') IpLevel = 12;//We found the third .
else IpLevel = 0; //we found numbers but not follow by number or .
}
case 11:{ // [XXX.XXX.XXX] we NEED a . or its not an IP
if(StrToChk[a] == '.') IpLevel++; //We find a . NEXT level
else IpLevel = 0;//We did not find a . Not an IP we keep looking
}
case 12:{
/*==================================================================
At this point in our string we found a patern similar
to this: [ XXX.XXX.XXX. ] IF our next character is a number
we can declare we found an IP in the string and return 1; .
==================================================================*/
if(IsNum(StrToChk[a])) return 1;//We find an IP patern we RETURN 1(true)
else IpLevel = 0;//did not find a number its NOT an IP we keep looking
}
}
}
return 0; //IP format patern was not found in the string.
}
IsNum(textchar) // Short function to find if a char is a num or not.
{
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;
}
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach