Tow question
#1

How to tow a vehicle with a tower ? Noob question
Reply
#2

It depends.

In single player, you lower the tow cable and approach the front of the target car, then raise the cable. After that, you lower it again to release the car. In SAMP, I think a command is used; Generally something like /tow.
Reply
#3

pawn Код:
COMMAND:tow(playerid,params[])
{
    #pragma unused params

    if(StateDriver[playerid])
    {
        new vehicleid=GetPlayerVehicleID(playerid);
        if(IsTrailerAttachedToVehicle(vehicleid))
            DetachTrailerFromVehicle(vehicleid);
        else
        {
            new trailerid=GetClosestVehicle(playerid,vehicleid);
            if(trailerid!=vehicleid && IsPlayerInRangeOfVehicle(playerid,10.0,trailerid))
                AttachTrailerToVehicle(trailerid,vehicleid);
        }
    }
    else
               SendClientMessage(playerid,0xAA3333AA,"You must be in vehicle to Tow.");
    return 1;
}
Reply
#4

Thanks
Reply
#5

No worries. By the way, I think the same pretty much applies for trucks/trailers and baggage vehicles/baggage carts, though you just reverse into them. I think they are mostly attached via a script command in SAMP also.
Reply
#6

Nope freddy smyth Trailers can be normally attached like in SP, only the Tow Truck can't tow like in SP.
Reply
#7

Something not important, but anyways, at jotan.
pawn Код:
CMD:some(playerid)
can also be used if there are no parameters.
Reply
#8

Instead of a command, I'd personally use KEY_ACTION. It has no other use so why not (apart from NOS, but who puts NOS on a tow truck?)?
Reply
#9

Quote:
Originally Posted by MP2
Посмотреть сообщение
Instead of a command, I'd personally use KEY_ACTION. It has no other use so why not (apart from NOS, but who puts NOS on a tow truck?)?
Didn't sa-mp 0.3d had that key for towing? I think i remember that.
Reply
#10

KEY_ACTION has always been there..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)