SA-MP Forums Archive
ERROR 025 : function heading differs from prototype - 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 025 : function heading differs from prototype (/showthread.php?tid=457237)



ERROR 025 : function heading differs from prototype - Jamcraftadam - 10.08.2013

I've been using the tutorial "How to implement RP chat" and I got these errors.

Код:
G:\Roleplay Server\pawno\include\sscanf2.inc(69) : warning 235: public function lacks forward declaration (symbol "OnNPCModeInit")
G:\Roleplay Server\gamemodes\rp.pwn(222) : error 025: function heading differs from prototype
G:\Roleplay Server\gamemodes\rp.pwn(223) : error 021: symbol already defined: "strreplace"
G:\Roleplay Server\gamemodes\rp.pwn(231) : warning 209: function "strreplace" should return a value
G:\Roleplay Server\gamemodes\rp.pwn(238) : error 035: argument type mismatch (argument 2)
G:\Roleplay Server\gamemodes\rp.pwn(643) : warning 203: symbol is never used: "IsNumeric"
G:\Roleplay Server\gamemodes\rp.pwn(643) : warning 203: symbol is never used: "ReturnUser"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Lines:

Код:
//-----Stocks------
stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
}

stock GetName(playerid)
{
    new
        name[24];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace(name, '_', ' ');
    return name;
}

stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}



Re: ERROR 025 : function heading differs from prototype - BullseyeHawk - 10.08.2013

Try to remove the stock strreplace(string[], find, replace).
It seems like you have one already defined somewhere in the script/include.


Re: ERROR 025 : function heading differs from prototype - Jamcraftadam - 10.08.2013

Quote:
Originally Posted by BullseyeHawk
Посмотреть сообщение
Try to remove the stock strreplace(string[], find, replace).
It seems like you have one already defined somewhere in the script/include.
Alrighty, thanks so far, as i am left with one error "G:\Roleplay Server\gamemodes\rp.pwn(227) : error 035: argument type mismatch (argument 2)" and that line is "strreplace(name, '_', ' ');"


Re: ERROR 025 : function heading differs from prototype - BullseyeHawk - 10.08.2013

I have no idea where there is another strreplace, but take your old one and name it strreplace2(string[], find, replace).

And then edit strreplace(name, '_', ' ');
strreplace2(name, '_', ' ');

That'd work..


Re: ERROR 025 : function heading differs from prototype - Jamcraftadam - 10.08.2013

Quote:
Originally Posted by BullseyeHawk
Посмотреть сообщение
I have no idea where there is another strreplace, but take your old one and name it strreplace2(string[], find, replace).

And then edit strreplace(name, '_', ' ');
strreplace2(name, '_', ' ');

That'd work..
It's come down to "Undefined Symbol", Any ideas?


Re: ERROR 025 : function heading differs from prototype - BullseyeHawk - 10.08.2013

Could you post the error? "Undefined Symbol" dosen't help here much :/..