How to teleport car with trailer?
#9

Quote:
Originally Posted by LarzI
Посмотреть сообщение
You could make a custom function

pawn Код:
stock SetVehicleAndTrailerPos(vehicleid, trailerid, Float:posx, Float:posy, Float:posz)
{
    new Float:bx, Float:by;
    GetVehicleTrailer( vehicleid );
    SetVehiclePos( vehicleid, posx, posy, posz );
    GetXYBehindVehicle( vehicleid, bx, by, 5.0 );
    SetVehiclePos( trailerid, bx, by, posz );
    AttachTrailerToVehicle( trailerid, vehicleid );
    return true;
}
pawn Код:
stock GetXYBehindOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
{
    new
        Float:a;
    GetVehiclePos( vehicleid, x, y, a );
    GetVehicleZAngle( vehicleid, a );
    x += ( distance * floatsin( -a+180, degrees ));
    y += ( distance * floatcos( -a+180, degrees ));
}
Can't garantuee that it will work 100%, or work at all.
Stocks are supposed to return a value, or am I wrong?
Reply


Messages In This Thread
How to teleport car with trailer? - by whitedragon - 12.09.2010, 09:53
Re: How to teleport car with trailer? - by LarzI - 12.09.2010, 10:45
Re: How to teleport car with trailer? - by whitedragon - 12.09.2010, 10:52
Re: How to teleport car with trailer? - by LarzI - 12.09.2010, 10:56
Re: How to teleport car with trailer? - by whitedragon - 12.09.2010, 11:07
Re: How to teleport car with trailer? - by LarzI - 12.09.2010, 11:10
Re: How to teleport car with trailer? - by LarzI - 12.09.2010, 11:19
Re: How to teleport car with trailer? - by Voldemort - 12.09.2010, 11:24
Re: How to teleport car with trailer? - by CrucixTM - 12.09.2010, 11:40
Re: How to teleport car with trailer? - by LarzI - 12.09.2010, 12:07

Forum Jump:


Users browsing this thread: 1 Guest(s)