ERROR 025 : function heading differs from prototype
#1

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);
        }
    }
}
Reply
#2

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

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, '_', ' ');"
Reply
#4

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..
Reply
#5

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?
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)