• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] HELP! How to Get Status If The Vehicle go Flipped while destroyed?
#1
I saw a gamemode that supports anti-vehicle explode during a flip which is usually a scene of gasoline spilling and a fire burning. But here the purpose that will be discussed is the opposite. How can the vehicle flip itself back to its normal condition if the vehicle has really flipped and is about to explode?
  Reply
#2
https://sampwiki.blast.hk/wiki/GetVehicleRotation
https://sampwiki.blast.hk/wiki/GetVehicleHealth
  Reply
#3
Code:
new Float:pP[3];

SetCameraBehindPlayer(playerid);
GetPlayerPos(playerid, pP[0], pP[1], pP[2]);

SetVehiclePos(GetPlayerVehicleID(playerid), pP[0], pP[1], pP[2]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
  Reply
#4
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);



Just this one line was enough.
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#5
Not if nobody is in the vehicle;
Quote:How can the vehicle flip itself
Might be a language barrier but I assumed (thanks to that line) the vehicle would be unmanned, in which case you would need the functions I sent.
Quote:(...) the vehicle has really flipped and is about to explode
GetVehicleRotation() to detect if it is flipped, GetVehicleHealth() to detect if it is on fire and thus about to explode. They start burning when the health is below 250, as stated on the wiki page. If it is, you indeed use SetVehicleZAngle() to flip it back.

Quote:SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
You might want to set it to the angle it's already facing. Otherwise it will always face North when flipping it. May be a tad inconvenient.
  Reply


Forum Jump: