Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2012-08-21, 19:32


steo







Wiek: 42
Na forum: 5045 dni
Posty: 16
Nick w MP: steo

Piwa: 95

Respekt: 50

Ostrzeżeń: 20%
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? ;]

Oto kod:


#include <a_samp>
#include <zcmd>
#include <dini>

new lastplayer,
lasttimer,
lastip[18];

static iPlayerChatTime[20];
static szPlayerChatMsg[20][128];

#define SCM SendClientMessage
#define SCMTA SendClientMessageToAll
#define Loop(%1,%2) for(new %1 = 0; %1 < %2; %1++)

#define COLOR_WHITE 0xFFFFFFC8
#define COLOR_LVIOLET 0x8080FFC8
#define COLOR_LGREEN 0x00FF00C8

#define WHITE "{FFFFFF}"
#define L_VIOLET "{8080FF}"
#define YELLOW "{DDDD22}"
#define L_GREEN "{00FF00}"


new Swears[50][128];
new num_words = 0;

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 ***");

new string[128], File:file;
if((file = fopen("swear.ini",io_read)))
{
while(fread(file,string))
{
for(new i = 0, j = strlen(string); i < j; i++) if(string[i] == '\n' || string[i] == '\r') string[i] = '\0';
Swears[num_words] = string;
num_words++;
}
fclose(file);
}
return 1;
}

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;
}
}

lastplayer = playerid;
lasttimer = GetTickCount();
format(lastip, sizeof lastip, playerip);
return 1;
}

public OnPlayerText(playerid, text[])
{
if(FindIP(text))
{
SCM(playerid, 0x800000C8, "[Ochrona Serwera] Nie reklamuj ip serwer?w na czacie");
return 0;
}

if(strfind(text,"www.",true) != -1 || strfind(text,"http:",true) != -1 || strfind(text,".com",true) != -1 || strfind(text,".net",true) != -1 || strfind(text,"91.",true) != -1 || strfind(text,".pl",true) != -1|| strfind(text,".org",true) != -1)
{
SCM(playerid, 0x800000C8, "[Ochrona Serwera] Nie reklamuj stron internetowych na czacie");
return 0;
}

if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text, false))
{
SendClientMessage(playerid, 0x800000C8, "[Ochrona Serwera] Nie powtarzaj tej samej wiadomo?ci");
format(szPlayerChatMsg[playerid], 128, "%s", text);
return 0;
}

if(IsPlayerFlooding(playerid))
{
SendClientMessage(playerid, 0x800000C8,"[Ochrona Serwera] Musisz odczeka? 2 sekundy od ostatniej wys?anej wiadomo?ci");
return 0;
}

for(new s = 0; s < num_words; s++)
{
new pos;
while((pos = strfind(text,Swears[s],true)) != -1) for(new i = pos, j = pos + strlen(Swears[s]); i < j; i++)
{
text[i] = '*';
}
}

format(szPlayerChatMsg[playerid], 128, "%s", text);
iPlayerChatTime[playerid] = GetTickCount();
return 1;
}

stock IsPlayerFlooding(playerid)
{
if(GetTickCount() - iPlayerChatTime[playerid] < 2000) return 1;
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;
}



Rzecz jasna b?d? piwa i respect ;p

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-21, 21:17


Combacior







Wiek: 29
Na forum: 5796 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
M?j skrypt dzia?a w 100%, na pewno si? z czym? gryzie. Je?eli ?adujesz jakie? inne skrypty, to za?aduj tylko ten m?j i sprawd?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-22, 10:56


steo







Wiek: 42
Na forum: 5045 dni
Posty: 16
Nick w MP: steo

Piwa: 95

Respekt: 50

Ostrzeżeń: 20%
"CombaT" napisał/a:

M?j skrypt dzia?a w 100%, na pewno si? z czym? gryzie. Je?eli ?adujesz jakie? inne skrypty, to za?aduj tylko ten m?j i sprawd?.


okey sprawdz?. Jak co? to edita dam.

@edit, a powiedz mi jeszcze co zrobi?, aby pisa?o zamiast przekle?stwa jaki? tekst kt?ry wpisze ?

@ edit 2 no nie dzia?a, sprawdza?em na 2 mapkach, bez skrypt?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-22, 11:30


B!4CK

Never give UP!






Wiek: 32
Na forum: 5810 dni
Posty: 1047
Nick w MP: John

Piwa: 1891

Respekt: 124,2
Respekt: 124,2

A by?e? zalogowany na rcon'a czy jako zwyk?y gracz?

Podpis
Cześć
! :)


Projekt, który poruszy scenę platformy SA:MP!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-22, 11:43


damian122851







Wiek: 30
Na forum: 5222 dni
Posty: 1



Respekt: 50

Tutaj bluzg
Kod:


public OnPlayerText(playerid, text[])
{
if(Bluzg(text))
{
format(dstring,sizeof(dstring),"%s zosta? wyrzucony), za: wulgaryzmy",playerid,Nick(playerid));
SendClientMessageToAll(KOLOR_ROZOWY,dstring);
Kick(playerid);
return 0;
}

stock Bluzg(text[])
{
if(strfind(text[0],"***",false)!=-1||
strfind(text[0],"c***",false)!=-1||
strfind(text[0],"k****",false)!=-1||
{
return 1;
}
return 0;
}



Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-22, 13:27


steo







Wiek: 42
Na forum: 5045 dni
Posty: 16
Nick w MP: steo

Piwa: 95

Respekt: 50

Ostrzeżeń: 20%
"blackelegy" napisał/a:

A by?e? zalogowany na rcon'a czy jako zwyk?y gracz?


Sprawdza?em i tak i tak

Postaw piwo autorowi tego posta
 

 
Tagi: anty :: przeklinanie :: spam :: flood :: www
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku