Help on a system
#1

I'm trying to make a system for the cars of placing objects, with the object editor, I put the object where I want and others, and in OnPlayerEditObject in EDIT_RESPONSE_FINAL I get the vehicle id, and I create a new one with the coordinates XYZ Rotation X Rotation Y (Z, Y, Z, RX, RY, RZ), and GetObjectPos (Objectivity, X, Y, Z) and GetObjectRot (objectid, RX, RY, RZ) ; "and the object is not placed where I want. Any solution? (Sorry for my English)

Code:

Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
	new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ;
	GetObjectPos(objectid, oldX, oldY, oldZ);
	GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);

	if(response == EDIT_RESPONSE_FINAL)
	{
	    if(Tunning == true)
	    {
			new vehicleid;
			vehicleid = GetPlayerVehicleID(playerid);
	    	new Float:X, Float:Y, Float:Z, Float:RX, Float:RY, Float:RZ;
	    	GetObjectPos(pAleron, X, Y, Z);
	    	GetObjectRot(pAleron, RX, RY, RZ);
			AttachObjectToVehicle(pAleron, vehicleid, X, Y, Z, RX, RY, RZ);
		}
	}

	if(response == EDIT_RESPONSE_CANCEL)
	{
	    Tunning = false;
		//The player cancelled, so put the object back to it's old position
		if(!playerobject) //Object is not a playerobject
		{
			SetObjectPos(objectid, oldX, oldY, oldZ);
			SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
		}
		else
		{
			SetPlayerObjectPos(playerid, objectid, oldX, oldY, oldZ);
			SetPlayerObjectRot(playerid, objectid, oldRotX, oldRotY, oldRotZ);
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)