Rotation - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Rotation (
/showthread.php?tid=78283)
Rotation -
Hot - 18.05.2009
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?
Re: Rotation -
Joe Staff - 18.05.2009
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;
}
Re: Rotation -
Hot - 18.05.2009
then i could use:
Код:
CreateObject(974, 1455.635010, -1687.656006, 138.699081, -10.013825, 0.00000, 0.000000);

??
Re: Rotation -
Hot - 18.05.2009
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!
Re: Rotation -
dice7 - 18.05.2009
Use this
http://gtamap.delux-host.com/converter/
You will find mta maps in C:\Program Files\MTA San Andreas\mods\map_editor\maps
Re: Rotation -
Weirdosport - 18.05.2009
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
Re: Rotation -
Joe Staff - 19.05.2009
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);