22.08.2011, 13:28
Something is wrong in this function, because when I start my server I get message "file or function not found", but when I change GetVehicleDistanceToPoint to some random number, it works.
and for example, if I change line
if ( GetVehicleDistanceFromPoint( vehicleid, X, Y, Z ) < radius )
to
if ( 20 < radius ) (its just example)
I dont get error.
pawn Код:
static stock GetClosestVehicle( playerid, Float: radius )
{
static
Float: X,
Float: Y,
Float: Z;
GetPlayerPos( playerid, X, Y, Z );
for ( new vehicleid; vehicleid != MAX_VEHICLES; ++ vehicleid )
{
if ( GetVehicleDistanceFromPoint( vehicleid, X, Y, Z ) < radius ) return vehicleid;
}
return INVALID_VEHICLE_ID;
}
and for example, if I change line
if ( GetVehicleDistanceFromPoint( vehicleid, X, Y, Z ) < radius )
to
if ( 20 < radius ) (its just example)
I dont get error.