GetVehiclePos clarification
#1

I am doing this car mod FS for a friend, and it is attaching car mod objects to any car. But attaching them is a pain in the arse, because I need to know the exact point from where to offset the object's position. Hence, I need to know what point's position does GetVehiclePos get? Is it like the centre of mass of the car or the 0th Z co - ordinate of the car's centre of mass's X and Y co - ords? I need to know it exactly so that I can do my offsets so that the MOD objects fit correctly to the car.
Hope you understand what I need
Cheers
Reply
#2

I'm not quite sure but I think this may help you - https://sampwiki.blast.hk/wiki/GetVehicleModelInfo.
Reply
#3

It's generally the center of the bottom of the vehicle, as far as I know. X and Y are at the center, Z is at the bottom.
Reply
#4

It gives the height, cool, but I am at a loss how to use it to attach an object to the car using the object editor.
I did something under FINAL_EDIT_SAVE (or something like that under OnPlayerEditObject) but it doesn't quite work.
Reply
#5

If you're asking how to find out what offsets to use, someone once said to place the vehicle at 0.0, 0.0, 3.0 and then whatever the coordinates are, they're going to be you're offsets (minus 3 from whatever the vehicle height is, it's about 3.2 so you'd probably have to tweak it a bit).
Reply
#6

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
It gives the height, cool, but I am at a loss how to use it to attach an object to the car using the object editor.
I did something under FINAL_EDIT_SAVE (or something like that under OnPlayerEditObject) but it doesn't quite work.
That will not work for this application, you need it entirely command based (for best results) for moving attached objects on a car I've mentioned this before about a week ago to someone else.

This is taken directly from my map editor.

Код:
// Vehicle Object Movement X-Axis
CMD:mvox(playerid, arg[])
{
	new Float:Movement;
	if(isnull(arg)) Movement = 1.0;
	else sscanf(arg, "f", Movement);

	if(EditCar[playerid][cVID] == INVALID_VEHICLE_ID || vehicles[playerid][MVASel[playerid]][object_id] == INVALID_OBJECT_ID) return 1;

	vehicles[playerid][MVASel[playerid]][ox] += Movement;
	AttachObjectToVehicle(vehicles[playerid][MVASel[playerid]][object_id], EditCar[playerid][cVID], vehicles[playerid][MVASel[playerid]][ox], vehicles[playerid][MVASel[playerid]][oy], vehicles[playerid][MVASel[playerid]][oz], vehicles[playerid][MVASel[playerid]][rx], vehicles[playerid][MVASel[playerid]][ry], vehicles[playerid][MVASel[playerid]][rz]);

	return 1;
}
Pretty basic to do.

1) Add increment to your array
2) Attach the object each time you give it a value

Now is it possible to use edit object, in a manner of way yes, you can use a dummy object like a ball record the initial position then subtract the initial position from final position giving you offsets but I'm thinking this would be pretty lousy also you car would be to be facing north I believe. EditObject() has shitty precision as well so getting things symmetrical commands are by far better suited.

Some results done entirely with commands. (Nothing beats those Zebra skin seats lol!)

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)