facing angle.
#1

hello, how can i make if i use /hi near npc he should look at me?
Reply
#2

http://forum.sa-mp.com/showpost.php?...4&postcount=21
Reply
#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
#4

its usage?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)