How to make Moving gate Please Help
#1

Hello, How to make Moving Gate

Please Guys If You Know Please Give it i dont know How to make Please !

Like

i made a Gate airport gate Obejct in mta

And

CreateObject(980,321.0000000,-1188.2000000,78.1000000,0.0000000,0.0000000,40.000 0000); //object(airportgate) (1)

How can i move with pass and move gate
Reply
#2

Use MoveObject and MoveDynamicObject: https://sampwiki.blast.hk/wiki/MoveObject
Here's a quick example, hope it works:
Код:
new gatemoved =0;
CMD:gate(playerid, params[])
{
    if (IsPlayerInRangeOfPoint(playerid, 20.0, -113.3937, 1666.2185, 17.9398))
    {
            if(gatemoved== 0)
            {
                SendClientMessage(playerid, -1, "Gate opened.");
                MoveDynamicObject(gate1, -98.1134, 1665.4869, 17.6971, 3); // Replace the coordinates and the object you want to move, in this case gate1
                gatemoved = 1;
            }
            else
            {
                SendClientMessage(playerid, -1, "Gate closed.");
                MoveDynamicObject(gate1, -104.77339,1665.48694,17.69710, 3);
                gatemoved = 0;
            }
        }
         return 1;
    }
If you use CreateDynamicObject use MoveDynamicObject, if you use CreateObject use MoveObject.
Reply
#3

how to do that LoL plz give me Expain !!!
Reply
#4

Do what exactly? The code I provided makes the object gate1 move from -104.77339,1665.48694,17.69710 to -98.1134, 1665.4869, 17.6971. You should have gate1 = CreateObject[ .etc] in your script.
Reply
#5

Quote:
Originally Posted by WingedFrostWolf
Посмотреть сообщение
Do what exactly? The code I provided makes the object gate1 move from -104.77339,1665.48694,17.69710 to -98.1134, 1665.4869, 17.6971. You should have gate1 = CreateObject[ .etc] in your script.
Bro 20.0 Range is too much
Reply
#6

Quote:
Originally Posted by K0P
Посмотреть сообщение
Bro 20.0 Range is too much
Eh, just an example.
@Omarkhan122211 You can use any range that suits you. 20 is quite large.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)