[Include] VehiclePartPosition
#14

Quote:
Originally Posted by Spmn
Посмотреть сообщение
You could use this function instead of ColAndreas
http://forum.sa-mp.com/showpost.php?...postcount=3972
You know if this function works on unoccupied vehicles?

@topic
You can get vehicle doors position using the same math on tires, but with seat info and adding the model X size (wide) divided by 2.0 ~ 3.0. Look:
PHP код:
// left front door
new Float:offXD;
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEAToffXoffYoffZ);
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZEoffXDoffZoffZ); // You'll never use OffZ value, so it's an "unused" var :D
fX += ( ( (offX + (offXD/2.5) + offset) * floatsin( -90.0degrees ) ) + ( ( offY floatsin( -Adegrees ) ) ) );
fY += ( ( (offX + (offXD/2.5) + offset) * floatcos( -90.0degrees ) ) + ( ( offY floatcos( -Adegrees ) ) ) );
// left back door
new Float:offXD;
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_REARSEAToffXoffYoffZ);
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZEoffXDoffZoffZ);
fX += ( ( (offX + (offXD/2.5) + offset) * floatsin( -90.0degrees ) ) + ( ( offY floatsin( -Adegrees ) ) ) );
fY += ( ( (offX + (offXD/2.5) + offset) * floatcos( -90.0degrees ) ) + ( ( offY floatcos( -Adegrees ) ) ) ); 
I'm dividing by 2.5 because it worked for my purposes and I haven't tested on all vehicles!

Sorry for my english.
Reply


Messages In This Thread
VehiclePartPosition - by Ivan_Ino - 30.10.2016, 21:06
Re: VehiclePartPosition - by xDaemon - 30.10.2016, 21:21
Re: VehiclePartPosition - by Spmn - 30.10.2016, 21:33
Re: VehiclePartPosition - by Ivan_Ino - 30.10.2016, 21:38
Re: VehiclePartPosition - by Kaliber - 30.10.2016, 23:23
Re: VehiclePartPosition - by Ivan_Ino - 31.10.2016, 13:05
Re: VehiclePartPosition - by Romz - 31.10.2016, 13:42
Re: VehiclePartPosition - by Ivan_Ino - 31.10.2016, 13:49
Re: VehiclePartPosition - by Spmn - 31.10.2016, 14:54
Re: VehiclePartPosition - by PT - 31.10.2016, 15:33
Re: VehiclePartPosition - by Spmn - 31.10.2016, 23:35
Re: VehiclePartPosition - by Lucky13 - 31.10.2016, 23:52
Re: VehiclePartPosition - by Ivan_Ino - 01.11.2016, 08:01
Re: VehiclePartPosition - by renatog - 05.11.2016, 01:03

Forum Jump:


Users browsing this thread: 1 Guest(s)