Detect vehicle angle - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Detect vehicle angle (
/showthread.php?tid=257759)
Detect vehicle angle -
Jay. - 27.05.2011
Hi, I've already searched the whole forum for this, but found nothing that really I needed.
Can someone show me a small example of how to detect if a vehicle is on it's roof?
Re: Detect vehicle angle -
sim_sima - 27.05.2011
GetVehicleZAngle
https://sampwiki.blast.hk/wiki/GetVehicleZAngle
Re: Detect vehicle angle -
Jay. - 27.05.2011
Quote:
Originally Posted by sim_sima
|
Yes i've seen that, but can you show me an example of how to use it?
Like ehh, how to detect if it's on its roof?
Re: Detect vehicle angle -
Vince - 27.05.2011
You'd need to get the X and Y angle for that, which is not possible with that function. Look into using GetVehicleRotationQuat.
Re : Detect vehicle angle -
Nero_3D - 27.05.2011
* To late *
Re: Detect vehicle angle -
Jay. - 27.05.2011
Thanks guys, maybe an example? I'm new to this function, never used it really.
AW: Re: Detect vehicle angle -
Nero_3D - 27.05.2011
Quote:
Originally Posted by Funtime
Thanks guys, maybe an example? I'm new to this function, never used it really.
|
Maybe
that topic helps, its a mess that JernejL and his tutorial disapeared
But there is an include about GetVehicleRotationQuat released (just search for it)
Re: Detect vehicle angle -
Markx - 27.05.2011
[Copyd from Wiki] Try to search better next time
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/vehrot", true) == 0)
{
new currentveh;
new Float:z_rot;
new message[32];
currentveh = GetPlayerVehicleID(playerid);
GetVehicleZAngle(currentveh, z_rot);
format(message, sizeof(message), "The current vehicle rotation is: %f", z_rot);
SendClientMessage(playerid, 0xFFFFFFFF, message);
return 1;
}
return 0;
}
Re: Detect vehicle angle -
Vince - 27.05.2011
Quote:
Originally Posted by Markx
[Copyd from Wiki] Try to search better next time
|
He wants to know how to detect if a vehicle is on its roof, which - as I already said - is
not possible with GetVehicleZAngle.
Re: Detect vehicle angle -
sim_sima - 28.05.2011
Well, if your trying to make a flip command/function in your server, you should simply just get the vehicle position in a variable, and then set the vehicle position to that variable, and then the vehicle will flip onto its wheels again.