[Include] VehiclePartPosition
#1

VehiclePartPosition


This is include but more like just function which allows you to get exact position for next parts of any vehicle

Left front tire
Right front tire
Left rear tire
Right rear tire
Hood
Trunk


Function:
Код:
GetXYZOfVehiclePart(vehicleid, part, &Float:x, &Float:y, &Float:z, Float:offset = 0.5)
Код:
 * vehicleid - Id of vehicle
 * part - Part (https://github.com/Ino42O/VehiclePar...sition.inc#L43), 
 * &Float:x - Out var 
 * &Float:y - Out var
 * &Float:z - Out var
 * Float:offset = 0.5 - Side offset with default value
Example:
Create a car with next command:
Код:
new car;
CMD:car(playerid, params[])
{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);

	car = CreateVehicle(strval(params), x, y+5.0, z, 0.0, -1, -1, 0);
	return 1;
}
And then try function
Код:
CMD:part(playerid, params[])
{
	new Float:x, Float:y, Float:z;
	GetXYZOfVehiclePart(car, strval(params), x, y, z);

	SetPlayerPos(playerid, x, y, z);
	return 1;
}
Changes:
31/10/2016
- Support if vehicle is not on flat ground (ColAndreas)


Download
https://github.com/Ino42O/VehiclePartPosition
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)