SA-MP Forums Archive
Is this possible? moving objects upon z level (smoothly) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Is this possible? moving objects upon z level (smoothly) (/showthread.php?tid=273495)



Is this possible? moving objects upon z level (smoothly) - Donya - 02.08.2011

Well, I came across a problem with my lastest work, I'd like to move a missile/object with z level

I tried like

pawn Код:
new Float:opos[2], Float:G_Z;
    GetDynamicObjectPos(objectid, opos[0], opos[1], G_Z);
    GetPointZPos(opos[0], opos[1], G_Z);
    /*if(!(G_Z < opos[2] - 7.0)) */
    MoveDynamicObject(objectid, opos[0], opos[1], G_Z + 0.9, 10000.0);

public OnDynamicObjectMoved(objectid)
{
    if(Move_ObjectX[objectid] != 0.0 && Move_ObjectY[objectid] != 0.0)
    {
        new Float:opos[2], Float:G_Z;
        GetDynamicObjectPos(objectid, opos[0], opos[1], G_Z);
        GetPointZPos(opos[0], opos[1], G_Z);
        MoveDynamicObject(objectid, Move_ObjectX[objectid], Move_ObjectY[objectid], G_Z + 0.9, MISSILE_SPEED);
    }
    return 1;
}
but it lags severely