facing angle.
#3

I have no clue what such an outdated code still gets used
He simply didn't knew that the function atan2 existed therefor he discerns all 4 sectors
pawn Code:
stock Float: GetZAngleBetweenPoints(Float: x1, Float: y1, Float: x2, Float: y2) {
    return -atan2(x2 - x1, y2 - y1);
}
pawn Code:
stock SetPlayerLookAtPlayer(playerid, giveplayerid) {
    new
        Float: pX,
        Float: pY,
        Float: gX,
        Float: gY,
        Float: Z,
    ;
    return
        GetPlayerPos(playerid, pX, pY, Z) &&
        GetPlayerPos(giveplayerid, gX, gY, Z) &&
        SetPlayerFacingAngle(playerid, GetZAngleBetweenPoints(pX, pY, gX, gY))
    ;
}
Reply


Messages In This Thread
facing angle. - by danish007 - 07.02.2015, 15:37
Re: facing angle. - by MicroD - 07.02.2015, 16:25
AW: facing angle. - by Nero_3D - 07.02.2015, 17:39
Re: facing angle. - by danish007 - 08.02.2015, 06:54

Forum Jump:


Users browsing this thread: 2 Guest(s)