21.04.2013, 23:07
i got this error i asked alot and i cant fix it
here are the lines;
pawn Код:
C:\Users\Daoud\Desktop\Pilots heaven\gamemodes\PH.pwn(3978) : warning 219: local variable "ID" shadows a variable at a preceding level
C:\Users\Daoud\Desktop\Pilots heaven\gamemodes\PH.pwn(3985) : error 022: must be lvalue (non-constant)
C:\Users\Daoud\Desktop\Pilots heaven\gamemodes\PH.pwn(3985) : warning 215: expression has no effect
C:\Users\Daoud\Desktop\Pilots heaven\gamemodes\PH.pwn(3988) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Pilots heaven\gamemodes\PH.pwn(3978) : warning 204: symbol is assigned a value that is never used: "ID"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
pawn Код:
GetNearestCoordsForPlayer(playerid)
{
new
Float:DefDist = 999999999.9,
Float:CurDist,
ID = -1;
for(new d; d != sizeof(ALocations); d++)
{
CurDist = GetPlayerDistanceFromPoint(playerid, ALocations[d][LocX], ALocations[d][LocY], ALocations[d][LocZ]);
if(CurDist < DefDist)
{
DefDist = CurDist;
ID = d;
}
}
return ID;
}