Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] HELP! How to Get Status If The Vehicle go Flipped while destroyed?

 
  • 0 Vote(s) - 0 Average
Pawn HELP! How to Get Status If The Vehicle go Flipped while destroyed?
PutuSuhartawan
Offline

Burgershot Member
Posts: 120
Threads: 52
Joined: Nov 2020
Reputation: 1
Location: Indonesia
#1
2021-07-08, 11:03 AM
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?
Kwarde
Offline

Burgershot Member
Posts: 99
Threads: 2
Joined: Sep 2020
Reputation: 8
Location: The Netherlands
#2
2021-07-08, 03:02 PM (This post was last modified: 2021-07-08, 03:03 PM by Kwarde.)
https://sampwiki.blast.hk/wiki/GetVehicleRotation
https://sampwiki.blast.hk/wiki/GetVehicleHealth
xbruno1000x
Offline

Burgershot Member
Posts: 32
Threads: 2
Joined: Mar 2020
Reputation: 1
Location: Brasil
#3
2021-07-09, 03:16 PM (This post was last modified: 2021-07-09, 03:17 PM by xbruno1000x.)
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);
portalsamp.com
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#4
2021-07-10, 12:50 AM
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.
Kwarde
Offline

Burgershot Member
Posts: 99
Threads: 2
Joined: Sep 2020
Reputation: 8
Location: The Netherlands
#5
2021-07-11, 08:54 AM (This post was last modified: 2021-07-11, 08:55 AM by Kwarde.)
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.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode