Throwing vehicle in air - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Throwing vehicle in air (
/showthread.php?tid=531007)
Throwing vehicle in air -
Lajko1 - 10.08.2014
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..
Re: Throwing vehicle in air -
Phyzic - 10.08.2014
You can first set Z to like 10 or 20, then SetTimer and then set it back to Player's Z angle.
Re: Throwing vehicle in air -
Lajko1 - 10.08.2014
Any other way also?
Re: Throwing vehicle in air -
[XST]O_x - 10.08.2014
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;
}
Re: Throwing vehicle in air -
Lajko1 - 11.08.2014
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
Re: Throwing vehicle in air -
SKAzini - 11.08.2014
1. Make sure the vehicle engine is on.
2. Make sure the player inside it isn't frozen.
3. Use SetVehicleVelocity.