SA-MP Forums Archive
[Include] [INC] a_angles - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] a_angles (/showthread.php?tid=105568)

Pages: 1 2


[INC] a_angles - Tannz0rz - 30.10.2009

Functions:
IsPlayerBehindPlayer(playerid, targetid, Float:dOffset)
SetPlayerToFacePlayer(playerid, targetid)
IsPlayerFacingPlayer(playerid, targetid, Float:dOffset)
AngleInRangeOfAngle(Float:a1, Float:a2, Float:range)

Example:
Code:
if(strcmp(cmdtext, "/assgrab", true)==0)
{
   if(IsPlayerBehindPlayer(playerid, targetid, 15.0))
   {
     SendClientMessageToAll(BLUE, "Someone in the server is getting frisky...");
   }
   else return SendClientMessage(playerid, RED, "You must be behind the target to perform the command.");
}
Download:



Re: [INC] a_angles - yom - 30.10.2009

You should describe to users what is dOffset(my bad) and give it a default value such as 15 or something, also i'm pretty sure i saw a IsPlayerFacingPlayer in the UF topic :P


Re: [INC] a_angles - Tannz0rz - 30.10.2009

Quote:
Originally Posted by 0rb
You should describe to users what is dOffset(my bad) and give it a default value such as 15 or something, also i'm pretty sure i saw a IsPlayerFacingPlayer in the UF topic :P
UF topic? Link plox


Re: [INC] a_angles - Chaprnks - 30.10.2009

Quote:
Originally Posted by Tannz0rz
UF topic? Link plox
Very old, and hard to find these days.


Re: [INC] a_angles - Tannz0rz - 30.10.2009

Quote:
Originally Posted by Chaprnks
Quote:
Originally Posted by Tannz0rz
UF topic? Link plox
Very old, and hard to find these days.
Oh well, I'll just let an admin delete this then I suppose. Didn't think that it had been done before.


Re: [INC] a_angles - R370 - 30.10.2009

is delet ?


Re: [INC] a_angles - Tannz0rz - 30.10.2009

Quote:
Originally Posted by R370
is delet ?
Apparently its already been done before, so I edited the first post.


Re: [INC] a_angles - Sergei - 30.10.2009

You are offended because someone said it has been done sometime before

Maybe that topic doesn't even exist anymore, so completly no reason for deleting something useful.


Re: [INC] a_angles - NeRoSiS - 30.10.2009

[url]https://sampwiki.blast.hk/wiki/Useful_Functions[/url

But that doesn't mean you u shouldn't release yours.


Re: [INC] a_angles - Sergei - 30.10.2009

Quote:
Originally Posted by Wazza!
[url]https://sampwiki.blast.hk/wiki/Useful_Functions[/url

But that doesn't mean you u shouldn't release yours.
Most of those functions from that wiki page were deleted if you haven't noticed.


Re: [INC] a_angles - Tannz0rz - 30.10.2009

Quote:
Originally Posted by $€ЯĢ
You are offended because someone said it has been done sometime before

Maybe that topic doesn't even exist anymore, so completly no reason for deleting something useful.
No, I just feel like an idiot for posting something that has apparently been created before. I'll add the DL link again if that's the case. Lmao


Re: [INC] a_angles - NeRoSiS - 30.10.2009

Quote:
Originally Posted by Tannz0rz
Quote:
Originally Posted by $ЂЯĢ
You are offended because someone said it has been done sometime before

Maybe that topic doesn't even exist anymore, so completly no reason for deleting something useful.
No, I just feel like an idiot for posting something that has apparently been created before. I'll add the DL link again if that's the case.
Put it back up, it was usefl and will help people.

You shouldnt feel like an idiot.


Re: [INC] a_angles - Toney - 16.11.2009

Nice. I will use it too now ^^


Re: [INC] a_angles - cyber_punk - 16.11.2009

I use it all the time, very useful. Thanks Tannz0rz!!


Re: [INC] a_angles - FreshKilla - 01.12.2009

This is useful ill try it out.


Re: [INC] a_angles - IamNotKoolllll - 01.12.2009

LOL /assgrab xD I'm gonna edit that into %s is getting frisky!!! Look out!
Lmfao!!!


Re: [INC] a_angles - mprofitt - 02.12.2009

I have been looking for something like this. Nice Work!


Re: [INC] a_angles - Kurence - 12.12.2009

I have made similar functions, but not that way.
My functions are more easy to understand.


Re: [INC] a_angles - _[HuN]_Epsilon_ - 06.01.2010

Quote:
Originally Posted by Kurence
I have made similar functions, but not that way.
We dont care about that and do not be pompous with those functions, becouse we just see a nice idea and a great release and an arrogant kid who speak about his invisible functions.


Re: [INC] a_angles - Coicatak - 06.02.2010

It seems like it doesn't work :/

Would this work?
pawn Код:
stock IsPlayerFacingPoint(playerid, x, y, radi)
{
  new Float:pX, Float:pY, Float:pZ, Float:Angle, Float:pAngle;
  GetPlayerPos(playerid, pX, pY, pZ);
  GetAngleToXY(x, y, pX, pY, Angle);
  if(pAngle - radi <= Angle && pAngle + radi >= Angle) return 1;
  return 0;
}

stock GetAngleToXY(Float:X, Float:Y, Float:CurrentX, Float:CurrentY, &Float:Angle)
{
  Angle = atan2(Y-CurrentY, X-CurrentX);
  Angle = floatsub(Angle, 90.0);
  if(Angle < 0.0) Angle = floatadd(Angle, 360.0);
}