Quote:
Originally Posted by AIped
It think this already does that...what exactly do you want with it ? check if a player is in front of you ?
Maybe you want something like this;
pawn Код:
stock GetXYSetAngle(playerid, &Float:x, &Float:y, Float:distance,Float:angle) { new Float:a; GetPlayerPos(playerid, x, y, a); GetPlayerFacingAngle(playerid, a); if (GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); } a += angle; x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); }
this checks the xy angle in front of you and the distance in that angle to be checked
|
I want to get the angle at which the player will be facing XY.
I want this code to return 120 (for the above case) by using the XY of the red object.