EDIT Object on vehicle
#1

Hello ,i have take this script,https://sampforum.blast.hk/showthread.php?tid=376910 for edit objet on a vehicle, but i woold like to upgrade this script and use all angles,no only the z.I think add the tangean but i'm lost.
Can you help me ?
Ps:Sorry for my bad english i'm french
Код:
public OnPlayerEditObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	if(response == EDIT_RESPONSE_CANCEL)
	{
		
	}
	if(response == EDIT_RESPONSE_FINAL)
 	{
		new vehicleid=GetPlayerVehicleID(playerid);
		new Float:X,Float:Y,Float:Z,Float:A;
		GetVehiclePos(vehicleid, X, Y, Z);
		GetVehicleZAngle(vehicleid, A);//For all angles use GetVehicleRotationQuat

		new Float:ofx, Float:ofy, Float:ofz, Float:ofaz;
		new Float:finalx, Float:finaly;
		new Float:px, Float:py, Float:pz, Float:roz;
  		GetVehiclePos(vehicleid, px, py, pz);
  		GetVehicleZAngle(vehicleid, roz);
		ofx = x-px;
		ofy = y-py;
		ofz = z-pz;
		ofaz = rz-roz;
		finalx = ofx*floatcos(roz, degrees)+ofy*floatsin(roz, degrees);
		finaly = -ofx*floatsin(roz, degrees)+ofy*floatcos(roz, degrees);
		AttachObjectToVehicle(AttachVehOb[playerid], vehicleid, finalx, finaly, ofz, rx, ry, ofaz);

	}
	return 1;
}
Reply
#2

I didnt understand a thing of what you said, please explain your problem better...
Reply
#3

I'd like to update this script to convert the w,y and z rotations
Reply
#4

No need to update, there is a better FS here https://sampforum.blast.hk/showthread.php?tid=282883
Reply
#5

Yes but i woold like to use sa-mp editor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)