[HELP] /tow
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Also check if "IsTrailerAttachedToVehicle" when you detach them.

Also have you tried different vehicle? might be a bugged one
Yes, and I just figured out the issue via printf.
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;
}
EDIT: I've fixed it. Adding 'Vehicle' to the exception fixed it. Thanks!
Reply


Messages In This Thread
[HELP] /tow - by BornHuman - 20.01.2015, 04:27
Re: [HELP] /tow - by xVIP3Rx - 20.01.2015, 04:32
Re: [HELP] /tow - by BornHuman - 20.01.2015, 04:36

Forum Jump:


Users browsing this thread: 2 Guest(s)