19.04.2009, 11:53
TurnPlayerFaceToPlayer
Turn another player's facing angle to a player.
Leopard
Turn another player's facing angle to a player.
pawn Код:
stock TurnPlayerFaceToPlayer(playerid, facingtoid)
{
new Float:angle;
new Float:misc = 5.0;
new Float:x, Float:y, Float:z;
new Float:ix, Float:iy, Float:iz;
GetPlayerPos(facingtoid, x, y, z);
GetPlayerPos(playerid, ix, iy, iz);
angle = 180.0-atan2(ix-x,iy-y);
angle += misc;
misc *= -1;
SetPlayerFacingAngle(playerid, angle+misc);
}