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



GetXYBehindThePlayer - arjanforgames - 21.07.2013

I see this being used in a filterscript, GetXYBehindThePlayer, but when I use it gives me:
pawn Код:
error 017: undefined symbol "GetXYBehindThePlayer"
Can someone help me?


Re: GetXYBehindThePlayer - [XST]O_x - 21.07.2013

Add this somewhere in your code:
pawn Код:
GetXYBehindPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;

    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    x -= (distance * floatsin(-a, degrees));
    y -= (distance * floatcos(-a, degrees));
}
Credit to dice7.


Re: GetXYBehindThePlayer - arjanforgames - 21.07.2013

And for InFrontOfPlayer? Sorry...


Re: GetXYBehindThePlayer - [XST]O_x - 21.07.2013

https://sampwiki.blast.hk/wiki/Stock_Fun...ultiple_values
Here.


Re: GetXYBehindThePlayer - arjanforgames - 21.07.2013

I'm really bad at math so just give me the code please.


EDIT: NVM, fixed.