Vehicle teleport coords
#6

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
Код:
 	new vehicle;
 	new Float:angle;
	vehicle = GetPlayerVehicleID(playerid);
  	SetPlayerPos(playerid, 58.9391,-134.7392,2.3367);
  	SetVehiclePos(vehicle, 58.9391,-134.7392,2.3367);
    GetVehicleZAngle(vehicle, angle);
    SetVehicleZAngle(vehicle, angle);
  	PutPlayerInVehicle(playerid, vehicle, 0);
You're setting the vehicle's angle to what it is when you exit the garage, which is why it isn't facing the right way. So if you're facing north when you exit the garage, the vehicle will come out facing north. You want to set it to the angle that is facing forward when you exit that garage. Angles are 0-360.

Here's an excerpt from the SA:MP Wiki:
pawn Код:
Angles are reversed in GTA:SA; 90 degrees would be East in the real world, but in GTA:SA 90 degrees is in fact West. North and South are still 0/360 and 180. To convert this, simply do 360 - angle.
So if you want it to face West when you exit, set the angle to 90.0.

Does that make sense?
Reply


Messages In This Thread
Vehicle teleport coords - by Zeus666 - 05.08.2018, 17:09
Re: Vehicle teleport coords - by Lokii - 05.08.2018, 17:32
Re: Vehicle teleport coords - by Zeus666 - 05.08.2018, 18:15
Re: Vehicle teleport coords - by BornHuman - 05.08.2018, 18:25
Re: Vehicle teleport coords - by Zeus666 - 05.08.2018, 18:28
Re: Vehicle teleport coords - by BornHuman - 05.08.2018, 18:35
Re: Vehicle teleport coords - by RogueDrifter - 05.08.2018, 18:49

Forum Jump:


Users browsing this thread: 2 Guest(s)