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



Objects Pos - usersamp - 15.01.2012

Why ObjectToPoint() doesn't work?


Re: Objects Pos - JamesC - 15.01.2012

ObjectToPoint is not a native function in SA-MP. If you want help regarding it, you must post the function here.


Re: Objects Pos - Mean - 15.01.2012

Use this:
pawn Код:
stock ObjectToPoint(Float:radi, objectid, Float:x, Float:y, Float:z)
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new Float:tempposx, Float:tempposy, Float:tempposz;
    GetObjectPos(objectid, oldposx, oldposy, oldposz);
    tempposx = (oldposx -x);
    tempposy = (oldposy -y);
    tempposz = (oldposz -z);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        return 1;
    }
    return 0;
}
My ObjectToPoint. Edited version of PlayerToPoint.