SA-MP Forums Archive
Error - 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)
+--- Thread: Error (/showthread.php?tid=445879)



Error - DAVIDXP - 23.06.2013

Hi i have some errors , here:
pawn Код:
stock strreplace( string[ ], const search[ ], const replacement[ ], bool:ignorecase = false, pos = 0, limit = -1, maxlength = sizeof( string ) )
Errors:
pawn Код:
error 025: function heading differs from prototype
error 025: function heading differs from prototype
error 025: function heading differs from prototype
fatal error 107: too many error messages on one line
Help please


Re: Error - dEcooR - 23.06.2013

Can you put here full stock pls


Re: Error - DAVIDXP - 23.06.2013

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
Can you put here full stock pls
pawn Код:
stock strreplace( string[ ], const search[ ], const replacement[ ], bool:ignorecase = false, pos = 0, limit = -1, maxlength = sizeof( string ) )
{
    if( limit == 0 )
        return 0;

    new sublen = strlen( search ), replen = strlen( replacement ), bool:packed = ispacked( string ),
        maxlen = maxlength, len = strlen( string ), count = 0;

    if( packed )
        maxlen *= 4;

    if( !sublen )
        return 0;

    while( -1 != ( pos = strfind( string, search, ignorecase, pos ) ) )
    {
        strdel( string, pos, pos + sublen );

        len -= sublen;

        if( replen && len + replen < maxlen )
        {
            strins( string, replacement, pos, maxlength );

            pos += replen;
            len += replen;
        }

        if( limit != -1 && ++ count >= limit )
            break;
    }

    return count;
}



Re: Error - dEcooR - 24.06.2013

Dude if you need replace string use this

str_replace(sSearch, sReplace, sSubject));

https://sampwiki.blast.hk/wiki/Strlib/str_replace