SA-MP Forums Archive
MoveObject - 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: MoveObject (/showthread.php?tid=625655)



MoveObject - Pearson - 04.01.2017

Hello.
Today i started creating deer hunting system.
Heres my code, but Object Is Not Stoping . Whats wrong?
I want to set angle on random and then Move Object Forward.
PHP код:
    for(new i;i<alldeers;i++)
    {
        if(
IsPlayerInRangeOfPoint(playerid10.0Huntingsys[i][deerx],Huntingsys[i][deery],Huntingsys[i][deerz]))
        {
            if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK) return 1;
            new 
Float:deerzrandom random(100);
            new 
Float:deerxrandom random(100);
            new 
Float:xikiFloat:yikiFloat:ziki;
            
GetDynamicObjectPos(Huntingsys[i][deerobject], xiki,yiki,ziki);
            new 
Float:xFloat:yFloat:z;
            
SetDynamicObjectRot(Huntingsys[i][deerobject], 0.00.0deerzrandom);
            
MoveDynamicObject(Huntingsys[i][deerobject],Xrand,Yrand,Zrand+0.3,speedRand,0,0,Angle);
            
MapAndreas_FindZ_For2DCoord(x,y,z);
            
MoveDynamicObject(Huntingsys[i][deerobject],deerxrandom,yiki,z5.0);
        }
    }