Problem with a stock
#1

pawn Код:
stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
}
That's the stock.

pawn Код:
C:\Documents and Settings\Dimitar\Desktop\samp03e_svr_win32\gamemodes\EsRp.pwn(97) : error 025: function heading differs from prototype
C:\Documents and Settings\Dimitar\Desktop\samp03e_svr_win32\gamemodes\EsRp.pwn(98) : error 021: symbol already defined: "strreplace"
C:\Documents and Settings\Dimitar\Desktop\samp03e_svr_win32\gamemodes\EsRp.pwn(106) : warning 209: function "strreplace" should return a value
C:\Documents and Settings\Dimitar\Desktop\samp03e_svr_win32\gamemodes\EsRp.pwn(113) : error 035: argument type mismatch (argument 2)
And i get these errors.What's the problem.
Reply
#2

Do you already have this Stock in your script...
pawn Код:
stock strreplaceEX(string[], find, replace)
{
    for(new i=0; strlen(string); i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
    return 1;
}
Reply
#3

1. You probably have forward, because...
2. The function is there already somewhere
3. return is needed
4. "A" != 'A' - first is string containing A\0, second one is single character
Reply
#4

Fixed.Thanks people.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)