10.02.2014, 11:48
The Error:
My Code:
PHP код:
warning 209: function "NearATrunk" should return a value.
PHP код:
stock bool:NearATrunk(PlayerID, &TheVehicleID)
{
for(new VehicleID = 0; VehicleID < MAX_VEHICLES; VehicleID++)
{
if(IsValidVehicle(VehicleID))
{
new Float:VehicleCoordinates[3];
GetVehiclePos(VehicleID, VehicleCoordinates[0], VehicleCoordinates[1], VehicleCoordinates[2]);
VehicleCoordinates[1] -= 2.865000;
VehicleCoordinates[2] -= 0.159999;
if(GetPlayerDistanceFromPoint(PlayerID, VehicleCoordinates[0], VehicleCoordinates[1], VehicleCoordinates[2]) <= 3)
{
TheVehicleID = VehicleID;
return true;
}
else
{
TheVehicleID = INVALID_VEHICLE_ID;
return false;
}
}
else
{
TheVehicleID = INVALID_VEHICLE_ID;
return false;
}
}
}