EDIT Object on vehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: EDIT Object on vehicle (
/showthread.php?tid=419400)
EDIT Object on vehicle -
Eloctro - 28.02.2013
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;
}
Re: EDIT Object on vehicle -
Apenmeeuw - 28.02.2013
I didnt understand a thing of what you said, please explain your problem better...
Re : EDIT Object on vehicle -
Eloctro - 08.03.2013
I'd like to update this script to convert the w,y and z rotations
Re: EDIT Object on vehicle -
DaRk_RaiN - 08.03.2013
No need to update, there is a better FS here
https://sampforum.blast.hk/showthread.php?tid=282883
Re : EDIT Object on vehicle -
Eloctro - 08.03.2013
Yes but i woold like to use sa-mp editor