0 270 playerid 90 ID 180 //so you see Id is south of him so the playerid angles to 180.
GetPlayerFacingAngle
SetPlayerFacingAngle
//In your command (arrest)
new Float:A;
GetPlayerFacingAngle(id, A);
SetPlayerFacingAngle(playerid, A);
stock Float:SetPlayerFaceToPoint( playerid, Float:PointX, Float:PointY )
{
new Float:eX, Float:eY, Float:eZ;
new Float:eAngle;
GetPlayerPos(playerid, eX, eY, eZ);
if(eX > PointX && eY > PointY) eAngle = floatabs(atan2(floatsub(PointX, eX), floatsub(PointY, eY)));
if(eX > PointX && eY <= PointY) eAngle = floatadd(floatabs(atan2(floatsub(eY, PointY), floatsub(PointX, eX))), 270.0);
if(eX <= PointX && eY > PointY) eAngle = floatadd(floatabs(atan2(floatsub(PointY, eY), floatsub(eX, PointX))), 90.0);
if(eX <= PointX && eY <= PointY) eAngle = floatadd(floatabs(atan2(floatsub(eX, PointX), floatsub(eY, PointY))), 180.0);
if(GetPlayerState( playerid ) == PLAYER_STATE_DRIVER) SetVehicleZAngle(GetPlayerVehicleID( playerid ), eAngle);
else SetPlayerFacingAngle(playerid, eAngle);
return eAngle;
}
That will only set the facing angle that the other player has, you are not facing towards the other player!
Use this function: |