Object Facing Angle?
#1

Well... Eh - As you see.. I am working on a new Dynamic system.. Where you can Create an Object ID... Anyway - I am facing a problem with the facing angle


This is a Part of the code :

Quote:

InfoBoardInfo[ID][ObjectID] = CreateDynamicObject(MyObjectID, InfoBoardInfo[ID][MyObjectX]+0.5, InfoBoardInfo[ID][MyObjectY], InfoBoardInfo[ID][MyObjectZ]+0.2, 0, 0, InfoBoardInfo[ID][InfoBoardAngle],0,0,-1,250);

Which creates the Object.. Anyway..

P.S - InfoBoardAngle = The object Facing Angle.. It's declared above..

Anyway - This is how it appears :



In this image [2nd] - The object should appear infront of me not behind me.. -.-




Any Ideas ? Help would be appreciated.

[Note : It works when I am facing this side as in the First SS - But in the 2nd - It doesn't.]
Reply
#2

Bump - Moved to the 2nd Page already.. Guys - I really need urgent help... Gonna give a Rep. Point to the one who'll help
Reply
#3

What about it?
It will create the object in front of the player.

PHP код:
new ObjID strval(params);
        new 
Float:XFloat:YFloat:ZFloat:Ang;
        
GetPlayerPos(playeridXYZ);
        
GetPlayerFacingAngle(playeridAng);
        
+= (floatsin(-Angdegrees));
        
+= (floatcos(-Angdegrees));
        
CreateObject(ObjIDXYZ0.00.0Ang); 
Reply
#4

Nope - not working -.-

- Bump , 3rd page already.
Reply
#5

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    // Created by ******
    new Float:a;

    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);

    if (GetPlayerVehicleID(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);

    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}

//For behind use
x -= (distance * floatsin(-a, degrees));
y -= (distance * floatcos(-a, degrees));
Reply
#6

Bump - An't working btw.
Reply
#7

Use what Viniborn said. There is a chance of 100% that it works. (or else you bugged up some script somewhere else.)
Reply
#8

Actually ye - I re-tried using it and it worked , Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)