SA-MP Forums Archive
hello guys, - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: hello guys, (/showthread.php?tid=225354)



hello guys, - Dr.Ghost - 13.02.2011

how to get anti advertisement?
example: in game typing IP address other server then get message after advertise ip to chat looking like this:
***.***.***.7777

. i have find another SEARCH .but didnt found.. i just ago minute get anti spam..

and sorry my bad english.


Re: hello guys, - HyperZ - 13.02.2011

OnPlayerText:
pawn Код:
new str[256];
new is1 = 0;
new r = 0;
while(strlen(text[is1]))
{
    if('0'<=text[is1]<='9')
    {
        new is2=is1+1;
        new p=0;
        while(p==0)
        {
            if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
            else
            {
                strmid(str[r],text,is1,is2,255);
                if(strval(str[r])<255) r++;
                is1 = is2;
                p = 1;
            }
        }
    }
    is1++;
}
if(r>=4)
{
    for(new z=0;z<r;z++)
    {
        new pr2;
        while((pr2=strfind(text,str[z],true))!=-1) for(new i=pr2,j=pr2+strlen(str[z]);i<j;i++) text[i]='*';
    }
}



Re: hello guys, - Dr.Ghost - 13.02.2011

Quote:
Originally Posted by Clive
Посмотреть сообщение
OnPlayerText:
pawn Код:
new str[256];
new is1 = 0;
new r = 0;
while(strlen(text[is1]))
{
    if('0'<=text[is1]<='9')
    {
        new is2=is1+1;
        new p=0;
        while(p==0)
        {
            if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
            else
            {
                strmid(str[r],text,is1,is2,255);
                if(strval(str[r])<255) r++;
                is1 = is2;
                p = 1;
            }
        }
    }
    is1++;
}
if(r>=4)
{
    for(new z=0;z<r;z++)
    {
        new pr2;
        while((pr2=strfind(text,str[z],true))!=-1) for(new i=pr2,j=pr2+strlen(str[z]);i<j;i++) text[i]='*';
    }
}
i do it OnPlayerText:
i get
Код:
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3081) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3083) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3087) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3089) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3090) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3093) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3101) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3103) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3106) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "is2"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "p"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "pr2"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "r"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "str"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.



Re: hello guys, - HyperZ - 13.02.2011

Quote:
Originally Posted by Dr.Ghost
Посмотреть сообщение
i do it OnPlayerText:
i get
Код:
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3081) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3083) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3087) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3089) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3090) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3093) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3101) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3103) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(3106) : error 010: invalid function or declaration
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "is2"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "p"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "pr2"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "r"
C:\Documents and Settings\user\Desktop\STUNTALL3ANTISPAM.pwn(4610) : warning 203: symbol is never used: "str"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
M not getting any error, it works perfect, put this under 'OnPlayerText' something like this:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new str[256];
    new is1 = 0;
    new r = 0;
    while(strlen(text[is1]))
    {
        if('0'<=text[is1]<='9')
        {
            new is2=is1+1;
            new p=0;
            while(p==0)
            {
                if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
                else
                {
                    strmid(str[r],text,is1,is2,255);
                    if(strval(str[r])<255) r++;
                    is1 = is2;
                    p = 1;
                }
            }
        }
        is1++;
    }
    if(r>=4)
    {
        for(new z=0;z<r;z++)
        {
            new pr2;
            while((pr2=strfind(text,str[z],true))!=-1) for(new i=pr2,j=pr2+strlen(str[z]);i<j;i++) text[i]='*';
        }
    }
    return 1;
}



Re: hello guys, - Dr.Ghost - 13.02.2011

Quote:
Originally Posted by Clive
Посмотреть сообщение
M not getting any error, it works perfect, put this under 'OnPlayerText' something like this:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new str[256];
    new is1 = 0;
    new r = 0;
    while(strlen(text[is1]))
    {
        if('0'<=text[is1]<='9')
        {
            new is2=is1+1;
            new p=0;
            while(p==0)
            {
                if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
                else
                {
                    strmid(str[r],text,is1,is2,255);
                    if(strval(str[r])<255) r++;
                    is1 = is2;
                    p = 1;
                }
            }
        }
        is1++;
    }
    if(r>=4)
    {
        for(new z=0;z<r;z++)
        {
            new pr2;
            while((pr2=strfind(text,str[z],true))!=-1) for(new i=pr2,j=pr2+strlen(str[z]);i<j;i++) text[i]='*';
        }
    }
    return 1;
}
Nice working. Thanks Bro

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase