[Object Rotation]Simple but I don't know.
#1

should be simple but im not sure how to do this. I just want this square piece simple spinning in a circle at a somewhat fast speed.

CreateDynamicObjectRot(3095, -429.92791748047, 2183.1071777344, 41.099998474121);


SetDynamicObjectRot(3095, -429.92791748047, 2183.1071777344, 41.099998474121);
ID X Y Z

for this function there's a X,Y,Z and I don't see anything to change the rotation.
Reply
#2

to specify this is using YSI, correct?

but the x y and z ARE the rotations, if you rotate the z the z is the one that stays the same, (looks like a top), y does a front flip, x does a barrel roll.
Reply
#3

Quote:
Originally Posted by Daren_Jacobson
to specify this is using YSI, correct?

but the x y and z ARE the rotations, if you rotate the z the z is the one that stays the same, (looks like a top), y does a front flip, x does a barrel roll.



I want to put this into a timer so its constantly spinning whats the SetDynamicObjectRot line suppose to look like?
Reply
#4

I reply would be kinda cool.
Reply
#5

You have to change the Z rotation.

pawn Код:
new Float:angle;

public RotateObject()
{
    SetDynamicObjectRot(objectid, 0, 0, angle);
    angle++;
    if(angle >= 360) angle = 0;
}
Reply
#6

that is not working, The object does not move. yet it compiles. if it makes any difference I combined this with a existing timer so i don't need extra:


This is used in a 2000ms timer:


pawn Код:
public CheckGate()
{
    new Float:angle;
    SetDynamicObjectRot(SQUARE, 0, 0, angle);
    angle++;
    if(angle >= 360) angle = 0;
       
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        // Gate3 (Cage) U
        if(PlayerToPoint(5.0, i,-423.699341, 2201.723145, 40.926292)&& OpenGateCage[i] == false) // Close --> Open
        {
            OpenGateCage[i] = true;
            MoveDynamicObject(Gate3, -423.692413, 2201.705811, 50.923096, 10.0);
            MoveDynamicObject(Gate4, -423.686127, 2206.743164, 45.926369, 10.0);
            MoveDynamicObject(Gate5, -418.655365, 2201.730713, 45.926369, 10.0);
            MoveDynamicObject(Gate6, -423.685608, 2196.700928, 45.913692, 10.0);
            MoveDynamicObject(Gate7, -428.733124, 2201.718506, 45.926338, 10.0);
        }
        else if(!PlayerToPoint(5.0, i,-423.699341, 2201.723145, 40.926292) && OpenGateCage[i] == true) // Open --> Close
        {
            OpenGateCage[i] = false;
            MoveDynamicObject(Gate3, -423.692413, 2201.705811, 59.923141, 1.5);
            MoveDynamicObject(Gate4, -423.686127, 2215.716309, 45.926369, 1.5);
            MoveDynamicObject(Gate5, -409.680603, 2201.730713, 45.926369, 1.5);
            MoveDynamicObject(Gate6, -423.685608, 2187.702881, 45.913692, 1.5);
            MoveDynamicObject(Gate7, -437.683075, 2201.718506, 45.926338, 1.5);
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by [SU
BP13 ]
that is not working, The object does not move. yet it compiles. if it makes any difference I combined this with a existing timer so i don't need extra:


This is used in a 2000ms timer:


pawn Код:
public CheckGate()
{
    new Float:angle;
    SetDynamicObjectRot(SQUARE, 0, 0, angle);
    angle++;
    if(angle >= 360) angle = 0;
       
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        // Gate3 (Cage) U
        if(PlayerToPoint(5.0, i,-423.699341, 2201.723145, 40.926292)&& OpenGateCage[i] == false) // Close --> Open
        {
            OpenGateCage[i] = true;
            MoveDynamicObject(Gate3, -423.692413, 2201.705811, 50.923096, 10.0);
            MoveDynamicObject(Gate4, -423.686127, 2206.743164, 45.926369, 10.0);
            MoveDynamicObject(Gate5, -418.655365, 2201.730713, 45.926369, 10.0);
            MoveDynamicObject(Gate6, -423.685608, 2196.700928, 45.913692, 10.0);
            MoveDynamicObject(Gate7, -428.733124, 2201.718506, 45.926338, 10.0);
        }
        else if(!PlayerToPoint(5.0, i,-423.699341, 2201.723145, 40.926292) && OpenGateCage[i] == true) // Open --> Close
        {
            OpenGateCage[i] = false;
            MoveDynamicObject(Gate3, -423.692413, 2201.705811, 59.923141, 1.5);
            MoveDynamicObject(Gate4, -423.686127, 2215.716309, 45.926369, 1.5);
            MoveDynamicObject(Gate5, -409.680603, 2201.730713, 45.926369, 1.5);
            MoveDynamicObject(Gate6, -423.685608, 2187.702881, 45.913692, 1.5);
            MoveDynamicObject(Gate7, -437.683075, 2201.718506, 45.926338, 1.5);
        }
    }
    return 1;
}
As you can see in my example I don't put new Float:angle; inside the function, but outside of it.
Reply
#8

Quote:
Originally Posted by Y_Leѕѕ
No, you need a fast timer to constantly update the angle, there is no object rotation functions in SA:MP for moving rotation, only angle setting. SetDynamicObjectRot is the angular equivalent to SetDynamicObjectPos, not MoveDynamicObject.
wow that's pretty brutal. So you are saying I need to save alot of different positions/angles of the object slightly to it appears as its moving frame by frame?


@MadeMan. It really makes no difference.
Reply
#9

Did you try it?

And it's suppose to move very slowly as you have a 2 sec timer moving it.
Reply
#10

I was expecting it to move faster then stationary.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)