05.08.2010, 23:17
Maybe it's because you are trying to return a float, try this:
Then you would need to do:
pawn Код:
stock GetMovedDistance(playerid, Float:posx, Float:posy, Float:posz, &Float:distance)
{
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:tmpdistance;
TempPos[playerid][0] = floatabs(posx-OldPos[playerid][0]);
TempPos[playerid][1] = floatabs(posy-OldPos[playerid][1]);
TempPos[playerid][2] = floatabs(posz-OldPos[playerid][2]);
tmpdistance = 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;
distance = tmpdistance;
return 1;//Tag Mismatch warning here
}
pawn Код:
new Float:Distance;
GetMovedDistance(playerid, X, Y, Z, Distance);
// Then use Distance as the float.