Facing Angle
#8

These warning and errors appear because you already have a variable called pX and pY declared as global
I won't tell you how to name your global variables but I advise you to add some indicator like the letter 'g' at the beginning

To fix that without changing any of your code just rename the local variables (from 'p' to 'a')
pawn Код:
SetPlayerToFacePlayer(playerid, targetid) {
    new
        Float: aX,
        Float: aY,
        Float: tX,
        Float: tY
    ;
    return
        GetPlayerPos(targetid, tX, tY, Float: targetid) &&
        GetPlayerPos(playerid, aX, aY, Float: targetid) &&
        SetPlayerFacingAngle(playerid, -atan2(tX - aX, tY - aY))
    ;
}
Reply


Messages In This Thread
Facing Angle - by Juvanii - 04.08.2014, 22:06
Re: Facing Angle - by DiGiTaL_AnGeL - 04.08.2014, 22:14
Re: Facing Angle - by ViniBorn - 04.08.2014, 22:23
Re: Facing Angle - by Juvanii - 04.08.2014, 22:37
Re: Facing Angle - by ViniBorn - 04.08.2014, 22:41
AW: Facing Angle - by Nero_3D - 04.08.2014, 22:49
Re: Facing Angle - by Juvanii - 04.08.2014, 22:57
AW: Facing Angle - by Nero_3D - 04.08.2014, 23:25
Re: Facing Angle - by Juvanii - 05.08.2014, 07:39

Forum Jump:


Users browsing this thread: 2 Guest(s)