The usage of vehicle barriers
#1

Well, as far as you all probably know, there are now vehicle barriers in the new 0.3e version.
And I'd like to know how to use it so it'll raise up and back down whilst switching rotation just like in this video:
[ame]http://www.youtube.com/watch?v=v5b6hurDl-o[/ame]
Reply
#2

Here's my original code for that video; it's somewhat messy though, because I made it quickly at the time.
I originally intended to also use those barriers on the south side of the road, but they messed up so I left that out.

pawn Код:
testbarrier[0] = CreateObject(19467, 1527.17, -1640.58, 12.375, 0.0, 0.0, 180.0); // north left - rotation x 300
testbarrier[1] = CreateObject(19467, 1532.00, -1640.58, 12.375, 0.0, 0.0, 180.0); // north right

COMMAND:testbarrier(playerid, params[])
{
    new Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
   
    for(new i; i < sizeof(testbarrier); i++)
    {
        GetObjectPos(testbarrier[i], x, y, z);
        GetObjectRot(testbarrier[i], rx, ry, rz);
       
        if(i == 0 || i == 1) // north barriers
        {
            if(rx == 300.0) // is open
            {
                MoveObject(testbarrier[i], x, y, z-0.01, 0.001, 0.0, ry, rz);
            }
            else // is closed
            {
                MoveObject(testbarrier[i], x, y, z+0.01, 0.001, 300.0, ry, rz);
            }
        }
    }
    return 1;
}
Reply
#3

Thank you very much, just a single question - did you use MTA intending to get the correct rotation?
Reply
#4

How do you guys get a specific value of rotation? with MTA?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)