SA-MP Forums Archive
How to revert this values??? - 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: How to revert this values??? (/showthread.php?tid=578923)



How to revert this values??? - JR_Junior - 23.06.2015

Hello everybody...

When I finish the object edition, the script make a new values to be saved, so I need revert the saved values to the old values:
pawn Код:
new Float:ox, Float:oy, Float:oz, Float:ofaz;
                        new Float:finalx, Float:finaly;
                        new Float:px, Float:py, Float:pz, Float:roz;
                        StopDynamicObject(objectid);
                        SetDynamicObjectPos(objectid,x,y,z);
                    SetDynamicObjectRot(objectid,rx,ry,rz);
                        GetVehiclePos(car, px, py, pz);
                        GetVehicleZAngle(car, roz);
                        ox = x-px;
                        oy = y-py;
                        oz = z-pz;
                        ofaz = rz-roz;
                        finalx = ox*floatcos(roz, degrees)+oy*floatsin(roz, degrees);
                        finaly = -ox*floatsin(roz, degrees)+oy*floatcos(roz, degrees);
                        AttachDynamicObjectToVehicle(AttachedObjects[car][0], car, finalx, finaly, oz, rx, ry, ofaz);
                        AttachedObjects_X[car][0] = finalx;
                        AttachedObjects_Y[car][0] = finaly;
                        AttachedObjects_Z[car][0] = oz;
                        AttachedObjects_RX[car][0] = rx;
                        AttachedObjects_RY[car][0] = ry;
                        AttachedObjects_RZ[car][0] = ofaz;
I want revert this:
pawn Код:
ox = x-px;
                        oy = y-py;
                        oz = z-pz;
                        ofaz = rz-roz;
                        finalx = ox*floatcos(roz, degrees)+oy*floatsin(roz, degrees);
                        finaly = -ox*floatsin(roz, degrees)+oy*floatcos(roz, degrees);
Thanks for any help!


Re: How to revert this values??? - JR_Junior - 23.06.2015

Someone can help me?


Re: How to revert this values??? - bigtigerbeee - 10.05.2017

Thank for ! Trunk System