Calculating if a text draw is colliding with a object.
#8

I don't know how to deal with textdraw.

Here's the function for aiming check, but it doesn't check z, because there's no such a 'z' angle.
pawn Код:
//Author:yezizhu
#define DisBetweenPoints(%1,%2,%3,%4,%5,%6) floatsqroot(((%1-%4)*(%1-%4))+((%2-%5)+(%2-%5))+((%3-%6)*(%3-%6)))

//Author:too many guys
 stock Float:getInfrontXY(&Float:x,&Float:y,Float:a,Float:distance){
  new
    Float:tmpx=x,
    Float:tmpy=y;
  x = tmpx+(distance*floatsin(-a, degrees));
  y = tmpy+(distance*floatcos(-a, degrees));
}

//Author:***** - Alex
#define PointToPoint(%0,%1,%2,%3,%4,%5,%6) (((%0 - %3) * (%0 - %3)) + ((%1 - %4) * (%1 - %4)) + ((%2 - %5) * (%2 - %5)) <= %6 * %6)
stock isPlayerAimingArea(playerid, Float,Float:y,Float:centre){
new
Floatx,Floaty,Floatz,Floata;
GetPlayerPos(playerid,px,py,pz);
GetPlayerFacingAngle(playerid,pa);
Float:getInfrontXY(px,py,pa,DisBetweenPoints(px,py ,0,x,y,0));
return PointToPoint(px,py,0,x,y,0,centre);
}[/pawn]
Note:More detail, DIY
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)