HTML Codes cleaning using pawn
#1

Hello,

im trying to create a function that will clean strings from html codes generated by mybb's/vB forums, but i get some erros.

Code:

PHP код:
static stock PraseClean(input[])
{
    new 
strx[][] =
    {
             
// start of function
            
"[color",
            
"[url",
            
"[b",
            
"[u",
            
"[s",
            
"[quote",
            
"[code",
            
"[php",
            
"[img",
            
"[size",
            
"[font",
            
"[align",
            
"[list",
            
"[email",
            
// end of function
            
"[/color",
            
"[/url"n
            
"[/b",
            
"[/u",
            
"[/s",
            
"[/quote",
            
"[/code",
            
"[/php",
            
"[/img",
            
"[/size",
            
"[/font",
            
"[/align",
            
"[/list",
            
"[/email"
    
};
    
    new 
xz// didn't found a nice naming, so sorry :/
    
for(new 0sizeof strxi++)
    {
        
strfind(inputstrx[i], true);
        if(
!= -1)
        {
            
strfind(input"]"true);
            
strdel(inputxz);
        }
    }
    return 
1;

Errors:
PHP код:
C:\Users\Xeon\Desktop\samp serv\filterscripts\mybb-connector.pwn(274) : error 010invalid function or declaration 
C
:\Users\Xeon\Desktop\samp serv\filterscripts\mybb-connector.pwn(274 -- 312) : error 010invalid function or declaration 
C
:\Users\Xeon\Desktop\samp serv\filterscripts\mybb-connector.pwn(274 -- 315) : error 010invalid function or declaration 
C
:\Users\Xeon\Desktop\samp serv\filterscripts\mybb-connector.pwn(274 -- 315) : fatal error 107too many error messages on one line 
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
4 Errors

Thank you!
Reply
#2

You have n instead of comma in your array
Код:
"[/url"n
Reply
#3

Thank you! didn't notice it.

--------------------------------------------------------------------------

Hello, im trying to evade double threads/posts

so im posting in same thread again.

here im trying to create a function that can insert '\n' for every 20 char in string.

PHP код:
static stock AutoReturn(input[])
{
    if(
strlen(input) > 20)
    {
        new    
strlen(input) / 20;
           for(new 
0kk++)
           {
            
strins(input"\n"20*kstrlen(input));
           }
    }
    return 
1;

Errors:
PHP код:

[debugRun time error 10"Native function failed"
[debug]  strins
[debugAMX backtrace:
[
debug#0 00002600 in AutoReturn (input[]=@000060bc "[align=center]Here some in
fo about our server[/align]") at C:\Users\Xeon\Desktop\samp serv\f
ilterscripts\mybb-connector.pwn:269
[debug] #1 000017c8 in public OnDialogResponse (playerid=0, dialogid=101, respon
se=1, listitem=1, inputtext[]=@00002728 "
Server Informations (IPHostname)") at
 C:\Users\Xeon\Desktop\samp serv\filterscripts\mybb-connector.pwn:
185 
Thank you!
Reply
#4

PHP код:
for(new 20strlen(string); j+= 21++)
{
    
strins(input"\n"ii);

Reply
#5

Quote:
Originally Posted by Paulice
Посмотреть сообщение
PHP код:
for(new 20strlen(string); j+= 21++)
{
    
strins(input"\n"ii);

thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)