Public function lacks forward declaration, Help!!! [REP +]
#1

Hi, I have made my new class for PPC Gamemode, but when I try to compile it I got error
Код:
(1) : error 010: invalid function or declaration
Line one is
Код:
forward IsAtFishPlace(playerid);
after compile, I got warning for it too
Код:
warning 235: public function lacks forward declaration (symbol "IsAtFishPlace")
and this is public function
Код:
public IsAtFishPlace(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    if(IsPlayerInRangeOfPoint(playerid,1.0,403.8266,-2088.7598,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,398.7553,-2088.7490,7.8359))
		{
		    return 1;
		}
		else if(IsPlayerInRangeOfPoint(playerid,1.0,396.2197,-2088.6692,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,391.1094,-2088.7976,7.8359))
		{
		    return 1;
		}
		else if(IsPlayerInRangeOfPoint(playerid,1.0,383.4157,-2088.7849,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,374.9598,-2088.7979,7.8359))
		{
		    return 1;
		}
		else if(IsPlayerInRangeOfPoint(playerid,1.0,369.8107,-2088.7927,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,367.3637,-2088.7925,7.8359))
		{
		    return 1;
		}
		else if(IsPlayerInRangeOfPoint(playerid,1.0,362.2244,-2088.7981,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,354.5382,-2088.7979,7.8359))
		{
		    return 1;
		}
		else if(IsPlayerInWater(playerid))
		{
			return 1;
		}
	}
	return 0;
}
Reply
#2

forward IsAtFishPlace(playerid);

make sure this line is directly above the public.

Or another simpler way:

pawn Код:
#define PUB:%1(%2) forward %1(%2); public %1(%2)
Then replace the "public" with "PUB:"
Reply
#3

Place the forward under your includes.
Reply
#4

Quote:
Originally Posted by kamzaf
Посмотреть сообщение
forward IsAtFishPlace(playerid);

make sure this line is directly above the public
You don't have to do that.
Reply
#5

Quote:
Originally Posted by kamzaf
Посмотреть сообщение
forward IsAtFishPlace(playerid);

make sure this line is directly above the public.

Or another simpler way:

pawn Код:
#define PUB:%1(%2) forward %1(%2); public %1(%2)
Then replace the "public" with "PUB:"
Didn't work, error 010: invalid function or declaration
&
Warning: public function lacks forward declaration (symbol "PUB")

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
Place the forward under your includes.
They are...

This is include for PPC(gamemode) new class
Reply
#6

No use: PUB:IsAtFishPlace(playerid)

not PUB isatfishplayer
Reply
#7

Quote:
Originally Posted by kamzaf
Посмотреть сообщение
No use: PUB:IsAtFishPlace(playerid)

not PUB isatfishplayer
This?
Код:
#define PUB:IsAtFishPlace(playerid) forward IsAtFishPlace(playerid); public IsAtFishPlace(playerid)
Reply
#8

At top of your script after includes:
pawn Код:
#define PUB:%1(%2) forward %1(%2); public %1(%2)
then somewhere:
pawn Код:
PUB:IsAtFishPlace(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid,1.0,403.8266,-2088.7598,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,398.7553,-2088.7490,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,396.2197,-2088.6692,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,391.1094,-2088.7976,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,383.4157,-2088.7849,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,374.9598,-2088.7979,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,369.8107,-2088.7927,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,367.3637,-2088.7925,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,362.2244,-2088.7981,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,354.5382,-2088.7979,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInWater(playerid))
        {
            return 1;
        }
    }
    return 0;
}
Reply
#9

Just rename function
Reply
#10

Quote:
Originally Posted by kamzaf
Посмотреть сообщение
At top of your script after includes:
pawn Код:
#define PUB:%1(%2) forward %1(%2); public %1(%2)
then somewhere:
pawn Код:
PUB:IsAtFishPlace(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid,1.0,403.8266,-2088.7598,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,398.7553,-2088.7490,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,396.2197,-2088.6692,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,391.1094,-2088.7976,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,383.4157,-2088.7849,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,374.9598,-2088.7979,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,369.8107,-2088.7927,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,367.3637,-2088.7925,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid,1.0,362.2244,-2088.7981,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,354.5382,-2088.7979,7.8359))
        {
            return 1;
        }
        else if(IsPlayerInWater(playerid))
        {
            return 1;
        }
    }
    return 0;
}
I did, but same error
PPC_MissionsFish.inc(1) : error 010: invalid function or declaration

Quote:
Originally Posted by stabker
Посмотреть сообщение
Just rename function
allready tryed...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)