SA-MP Forums Archive
how i fix - 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: how i fix (/showthread.php?tid=309754)



how i fix - Tanush123 - 09.01.2012

Код:
D:\Users\Tanush\Desktop\SA-MP SERVERS\SA-MP Server Stunt\gamemodes\server.pwn(7384) : warning 208: function with tag result used before definition, forcing reparse
pawn Код:
stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    else GetPlayerFacingAngle(playerid, a);
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
    return a;
}
how i fix that error


Re: how i fix - Norck - 09.01.2012

Just add
pawn Код:
forward Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
somewhere before 7384 line.


Re: how i fix - sGarfield - 09.01.2012

You can post: line 7384 ?

pawn Код:
forward GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
        new Float:a;
        GetPlayerPos(playerid, x, y, a);
        if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
        else GetPlayerFacingAngle(playerid, a);
        x += (distance * floatsin(-a, degrees));
        y += (distance * floatcos(-a, degrees));
        return a;
}
Try this..


Re: how i fix - Konstantinos - 09.01.2012

Add the stock at the end of the script.


Re: how i fix - Tanush123 - 09.01.2012

Quote:
Originally Posted by Norck
Посмотреть сообщение
Just add
pawn Код:
forward Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
somewhere before 7384 line.
thanks, repped all