[Include] [INC] a_angles
#1

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:
Reply
#2

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
Reply
#3

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
Reply
#4

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

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.
Reply
#6

is delet ?
Reply
#7

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

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.
Reply
#9

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

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

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.
Reply
#11

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
Reply
#12

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.
Reply
#13

Nice. I will use it too now ^^
Reply
#14

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

This is useful ill try it out.
Reply
#16

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

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

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

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.
Reply
#20

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);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)