Object disappearing when AttachObjectToVehicle is used
#1

The issue is in the title.

Video of the object disappearing: https://www.youtube.com/watch?v=ro_R...ature=*********

OnPlayerEditObject:

Код:
new carid = GetPVarInt(playerid, "carID"), carSlot = GetPVarInt(playerid, "carSlot");
	if(carid)
	{
		 if(response != EDIT_RESPONSE_UPDATE)
		 {
			 if (response == EDIT_RESPONSE_FINAL)
			 {
				  if (IsValidObject(CarData[carid][carObjectEx][carSlot]))
				  {
					  carObjectPos[carid][carSlot][0] = fX;
					  carObjectPos[carid][carSlot][1] = fY;
					  carObjectPos[carid][carSlot][2] = fZ;

					  carObjectPos[carid][carSlot][3] = fRotX;
					  carObjectPos[carid][carSlot][4] = fRotY;
					  carObjectPos[carid][carSlot][5] = fRotZ;
					  
					  AttachObjectToVehicle(CarData[carid][carObjectEx][carSlot], CarData[carid][carVehicle], fX, fY, fZ, fRotX, fRotY, fRotZ);

					  SendClientMessageEx(playerid, COLOR_LIGHTRED, "%s placed.", ReturnWeaponName(CarData[carid][carWeapons][carSlot]));
				  }
				  else SendServerMessage(playerid, "Found an error. Report this bug on the forums. (could not find object)");
			 }
			 else if (response == EDIT_RESPONSE_CANCEL)
			 {
                  if (IsValidObject(CarData[carid][carObjectEx][carSlot]))
				  {
					  carObjectPos[carid][carSlot][3] = 0.0;
					  carObjectPos[carid][carSlot][4] = 0.0;
					  carObjectPos[carid][carSlot][5] = 0.0;

					  AttachObjectToVehicle(CarData[carid][carObjectEx][carSlot], CarData[carid][carVehicle], carObjectPos[carid][carSlot][0], carObjectPos[carid][carSlot][1], carObjectPos[carid][carSlot][2], 0.0, 0.0, 0.0);

					  SendClientMessageEx(playerid, COLOR_LIGHTRED, "%s placed.", ReturnWeaponName(CarData[carid][carWeapons][carSlot]));
				  }
				  else SendServerMessage(playerid, "Found an error. Report this bug on the forums. (could not find object)");
			 }

			 DeletePVar(playerid, "carID");
			 DeletePVar(playerid, "carSlot");

			 Car_Refresh(carid);
		 }
    }
Reply
#2

Код:
AttachObjectToVehicle(CarData[carid][carObjectEx][carSlot], CarData[carid][carVehicle], fX, fY, fZ, fRotX, fRotY, fRotZ);
That isn't going to work without any delta offsetting look at how Texture Studio does this there is a lot more to it.
https://github.com/Pottus/Texture-St...o/vehicles.pwn

Specifically
Код:
OnPlayerEditVObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
Reply
#3

What do you mean? The offsets are there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)