Throwing vehicle in air
#1

How can I make that vehicle will be thrown in air and then it will fall down.. I tried to raise vehicle's Z coordinate but vehicle is stuck in air..
Reply
#2

You can first set Z to like 10 or 20, then SetTimer and then set it back to Player's Z angle.
Reply
#3

Any other way also?
Reply
#4

pawn Код:
stock ThrowVehicle(vehicleid, Float: height)
{
    new Float: x, Float: y, Float: z;
    GetVehicleVelocity(vehicleid, x, y, z);
    SetVehicleVelocity(vehicleid, x, y, z+height);
    return 1;
}
Reply
#5

pawn Код:
for(new a = 1; a < MAX_VEHICLES - 1; a++)
            {
                if (!GetVehiclePos(a, pX, pY, pZ)) continue; // vehicle does not exist
                if(BombOnVehicle[a] == 1)
                {
                    ThrowVehicle(a, 3);
                    BombOnVehicle[a] = 0;
                    PlantedBomb[playerid] = 0;
                    CreateExplosion(pX, pY, pZ, 4, 5.0);
                    CreateExplosion(pX, pY, pZ, 5, 5.0);
                    CreateExplosion(pX, pY, pZ, 6, 5.0);
                    break;
                }
            }
Tried your code and it's not working
Reply
#6

1. Make sure the vehicle engine is on.
2. Make sure the player inside it isn't frozen.
3. Use SetVehicleVelocity.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)