Police Barriers?
#1

Okay, well I need barriers for the SFPD.. I have the cords and everything but I cant seem to get it..

What it does is if I type /gate near the object, it will open (stand up) and close after a little bit..

pawn Код:
if(GateOpen2 == 0) {
                format(string, sizeof(string), "* %s uses their remote to open the gates.", GetName(playerid));
                NearByMessage(playerid, NICESKY, string);
                MoveDynamicObject(sfpdbarrier, -1572.20983887,658.81811523,6.77031469, 1);
                GateOpen2 = 1;
                SetTimer("CloseSFPDGate2", 5000, false);
            }
            else {
                SendClientMessage(playerid, WHITE, "The gate is already open, wait for it to close.");
            }
        }
    }
Timer
pawn Код:
public CloseSFPDGate2()
{
    MoveDynamicObject(sfdbarrier, -1572.21887207,658.75366211,6.77031469, 1);
    GateOpen2 = 0;
    return 1;
}
Reply
#2

Quote:

SetTimer("CloseSFPDGate2", 5000, false);

The 5000 is miliseconds So change that to the closing time
Reply
#3

Look at this:

SetObjectPos
SetObjectRot

They should help you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)