The usage of vehicle barriers - 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)
+--- Thread: The usage of vehicle barriers (
/showthread.php?tid=331110)
The usage of vehicle barriers -
Tomer!.$ - 03.04.2012
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]
Re: The usage of vehicle barriers -
Vince - 03.04.2012
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;
}
Re: The usage of vehicle barriers -
Tomer!.$ - 04.04.2012
Thank you very much, just a single question - did you use MTA intending to get the correct rotation?
Re: The usage of vehicle barriers -
Tomer!.$ - 04.04.2012
How do you guys get a specific value of rotation? with MTA?