Player face player
#4

You should / could knew who gets the extra 180° if you wrote the calculation...

Full and working function
pawn Код:
stock SetPlayerFacePlayer(playerid, giveplayerid) {
    new
        Float: pX,
        Float: pY,
        Float: pZ,
        Float: gX,
        Float: gY,
        Float: gZ
    ;
    if(GetPlayerPos(playerid, pX, pY, pZ) && GetPlayerPos(giveplayerid, gX, gY, gZ)) {
        SetPlayerFacingAngle(playerid, (pX = -atan2((gX - pX), (gY - pY))));
        return SetPlayerFacingAngle(giveplayerid, (pX + 180.0));
    }
    return false;
}
Also using arrays is slower than normal variables, just use them if you need them
Reply


Messages In This Thread
Player face player - by Qur - 22.10.2012, 19:26
Re: Player face player - by Babul - 22.10.2012, 20:11
Re: Player face player - by Qur - 22.10.2012, 21:00
AW: Player face player - by Nero_3D - 22.10.2012, 21:36

Forum Jump:


Users browsing this thread: 1 Guest(s)