Rotation
#1

Okay, I collected some information at MTA: Map Editor, to get the rotation. I pressed F3 to see the rotation of my object. and...

Код:
-10.013825, 0.0000, 0.0000.
Okay so, the roation is a RotX (-10.13825), and I get the firts X coordinate to identify my object.
I write at my notepad: 1455.635010(That's the X coordinate to I remember)

So I converted from .map to pawn code. and than i found it:

CreateObject(974, 1455.635010, -1687.656006, 138.699081, 0.0000, 0.0000, 146.2500);

It's the object coordinate, but the rotation isn't the same i collected from MTA!

Any help?


Reply
#2

SA-MP uses an angle, while I think MTA uses radians? Or something, to convert use this.


Taken from ******' YSI script
pawn Код:
stock Float:Loader_Convert(Float:radians)
{
    if (radians == 0.0)
    {
        return 0.0;
    }
    new Float:retval = (360.0 + (radians / 0.0174532925));
    while (retval >= 360.0) retval -= 360.0;
    while (retval < 0.0) retval += 360.0;
    return retval;
}
Reply
#3

then i could use:

Код:
CreateObject(974, 1455.635010, -1687.656006, 138.699081, -10.013825, 0.00000, 0.000000);
??
Reply
#4

PLEASE HELP! I TRIED :

Код:
CreateObject(974, 1455.635010, -1687.656006, 138.699081, -10.013825, 0.00000, 0.000000);
with:

pawn Код:
stock Float:Loader_Convert(Float:radians)
{
if (radians == 0.0)
{
return 0.0;
}
new Float:retval = (360.0 + (radians / 0.0174532925));
while (retval >= 360.0) retval -= 360.0;
while (retval < 0.0) retval += 360.0;
return retval;
}
AND DIDN'T WORK! HELP!
Reply
#5

Use this
http://gtamap.delux-host.com/converter/

You will find mta maps in C:\Program Files\MTA San Andreas\mods\map_editor\maps
Reply
#6

Hot, you angles you've got are in radians, you need to convert them to degrees. To do this, take the value, times it by 360 and divide by (pi x 2).

-10.013825 radians -> -573.749909 degrees -> 146.250091 degrees
Reply
#7

He just doesn't know how to use it.

pawn Код:
CreateObject(974, 1455.635010, -1687.656006, 138.699081,Loader_Convert(-10.013825), 0.00000, 0.000000);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)