Return Problem
#1

Hey!

I want this function to return a float value, but the compiler writes a warning..Here is the code:

pawn Код:
new Float:OldPos[MAX_PLAYERS][3];
pawn Код:
stock GetMovedDistance(playerid, Float:posx, Float:posy, Float:posz)
{
    if(OldPos[playerid][0] == 0 || OldPos[playerid][1] == 0 || OldPos[playerid][2] == 0)
    {
        GetPlayerPos(playerid, OldPos[playerid][0],  OldPos[playerid][1],  OldPos[playerid][2]);
        return 0;
    }
    new
        Float:TempPos[MAX_PLAYERS][3],
        Float:distance;
    TempPos[playerid][0] = floatabs(posx-OldPos[playerid][0]);
    TempPos[playerid][1] = floatabs(posy-OldPos[playerid][1]);
    TempPos[playerid][2] = floatabs(posz-OldPos[playerid][2]);
    distance = floatsqroot(floatpower(TempPos[playerid][0], 2)+floatpower(TempPos[playerid][1], 2)+floatpower(TempPos[playerid][2], 2));
    OldPos[playerid][0] = posx;
    OldPos[playerid][1] = posy;
    OldPos[playerid][2] = posz;
    return distance;//Tag Mismatch warning here
}
What's the problem?
Reply


Messages In This Thread
Return Problem - by Nonameman - 05.08.2010, 23:11
Re: Return Problem - by Conroy - 05.08.2010, 23:17
Re: Return Problem - by JaTochNietDan - 05.08.2010, 23:18
Re: Return Problem - by Conroy - 05.08.2010, 23:19
Re: Return Problem - by Nonameman - 05.08.2010, 23:21

Forum Jump:


Users browsing this thread: 1 Guest(s)