20.01.2015, 04:36
Quote:
Also check if "IsTrailerAttachedToVehicle" when you detach them.
Also have you tried different vehicle? might be a bugged one |
Getting the closest vehicle just gets the vehicle I'm in, not the vehicle I'm wanting to tow.
Here's the stock:
pawn Код:
stock GetClosestCar(iPlayer, iException = INVALID_VEHICLE_ID, Float: fRange = Float: 0x7F800000) {
new
iReturnID = INVALID_VEHICLE_ID,
Float: fVehiclePos[4];
for(new i = 1; i <= MAX_VEHICLES; ++i) if(GetVehicleModel(i) && i != iException) {
GetVehiclePos(i, fVehiclePos[0], fVehiclePos[1], fVehiclePos[2]);
if((fVehiclePos[3] = GetPlayerDistanceFromPoint(iPlayer, fVehiclePos[0], fVehiclePos[1], fVehiclePos[2])) < fRange) {
fRange = fVehiclePos[3];
iReturnID = i;
}
}
return iReturnID;
}