#1

How can i make like, it set's an object facing angle to my facing angle?
Like if Im facing north and the object is facing south, and i press KEY_FIRE it set's the object facing angle to north?
I know it's with SetObjectRot but im not sure how to make it.
Reply
#2

pawn Код:
stock SetObjectRotToPlayerAngle(i_Obj, i_Player) // admantis
{
    new
        Float:f_Angle
        ,Float:f_rX
        ,Float:f_rY
        ,Float:f_rZ
    ;
   
    if (i_Player == 0xFFFF || !IsValidObject(i_Obj))
        return false;

    GetPlayerFacingAngle(i_Player, f_Angle);
    GetObjectRot(i_Obj, f_rX, f_rY, f_rZ);
    SetObjectRot(i_Obj, f_rX, f_rY, f_Angle);

    return i_Obj;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)