Invalid function declaration?
#1

I got the Invalid function declaration error and a warning along in its next line, Heres my code, could you review it as to
let me know whats wrong?
pawn Код:
D:\ Gaming\gamemodes\eg-rp.pwn(6403) : error 010: invalid function or declaration
D:\ Gaming\gamemodes\eg-rp.pwn(6404) : warning 235: public function lacks forward declaration (symbol "SetPlayerToFacePos")
Reply
#2

you should post the error line code.
Reply
#3

Show us the Code of Line 6403.

Problem #2 (6404) :-
Код:
forward Potato(playerid);
public Potato(playerid)
{
    //Codes
}
Another Example,
Код:
forward countdown();
public countdown()
{
    //Codes
}
EDIT :-
Код:
forward Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y)
{
    //Codes
}
Reply
#4

OMG I am sorry, i forgot that lol.
pawn Код:
forwad Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y)
{
    new
        Float:local_pX,
        Float:local_pY,
        Float:local_pZ,
        Float:ang;

    GetPlayerPos(playerid, local_pX, local_pY, local_pZ);

    if( Y > local_pY ) ang = (-acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 90.0);
    else if( Y < local_pY && X < local_pX ) ang = (acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 450.0);
    else if( Y < local_pY ) ang = (acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 90.0);

    if(X > local_pX) ang = (floatabs(floatabs(ang) + 180.0));
    else ang = (floatabs(ang) - 180.0);

    ang += 180.0;

    SetPlayerFacingAngle(playerid, ang);

    return ang;
}
Reply
#5

Quote:
Originally Posted by Imperor
Посмотреть сообщение
OMG I am sorry, i forgot that lol.
pawn Код:
forwad Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y)
{
    new
        Float:local_pX,
        Float:local_pY,
        Float:local_pZ,
        Float:ang;

    GetPlayerPos(playerid, local_pX, local_pY, local_pZ);

    if( Y > local_pY ) ang = (-acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 90.0);
    else if( Y < local_pY && X < local_pX ) ang = (acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 450.0);
    else if( Y < local_pY ) ang = (acos((X - local_pX) / floatsqroot((X - local_pX)*(X - local_pX) + (Y - local_pY)*(Y - local_pY))) - 90.0);

    if(X > local_pX) ang = (floatabs(floatabs(ang) + 180.0));
    else ang = (floatabs(ang) - 180.0);

    ang += 180.0;

    SetPlayerFacingAngle(playerid, ang);

    return ang;
}
Seriously 'forwad', change 'forwad' to 'forward'.
Reply
#6

No wonder i dont see "fowad" anywhere.
Reply
#7

Quote:
Originally Posted by Imperor
Посмотреть сообщение
No wonder i dont see "fowad" anywhere.
I wonder, i saw "forwad" anywhere.

EDIT :-

Problem #1 (6403) :-
Change,
Код:
forwad Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
to
Код:
forward Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
Reply
#8

Opps lol thanks i am sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)