moveobject / mapping error
#1

Hi. I want to move the object only by rotation. How can i do that?

PHP код:
CMD:sdgate(playeridparams[])
{
    if(
pInfo[playerid][pFaction] != 1) return SendClientMessage(playeridCOLOR_WHITE"You are not from Sherrif Department");
    if(
IsPlayerInRangeOfPoint(playerid5.0125.4551,-130.3049,1.5781))
    {
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have opened the gate. It will close after five seconds.!");
         
MoveObject(barierasd122.7600, -134.01191.31610.000090.00000.4000); //barrierturn
         
SetTimerEx("sdgate"5000false"i"playerid);
    }
    else
    {
        
SendClientMessage(playerid, -1"{FFCC33}You are not near the gate!");
    }
    return 
1;

Reply
#2

The last 3 parameters in MoveObject are the object's rotations. Try messing with them until you get the rotation you want. The first one is rotation in the X axis, the second one is rotation in the Y axis and last one is Z.
Reply
#3

For the rotation to work the object also needs to be moved, unfortunately.

So, if you want to rotate an object for 1 second, you need to move it by (for example) 0.1 meters at a speed of 0.1 m/s. If you want it to rotate for 3 seconds, move it by 0.3 meters at a speed of 0.1 m/s or 0.1 meters at a speed of 0.03333 m/s.

Just choose the smallest distance possible (so it doesn't become visible) and use the formula t = d/s so you can easily calculate the speed needed for it to move t seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)