Automatic Command Gates
#1

How to i make multiple automatic gates that will open by command and close automatically like this?

Код:
public EL3DOWN()
{
	MoveObject(EL3,1573.691,-1685.959,28.746, 3.5);//Embaixo
	MoveObject(EL3,1573.717,-1685.977,41.382, 3.5);//Encima
	return 1;
}
I've tried it this way.. Only problem, i dont know which is open and which is close

I've searched, i only found IsPlayerInRangeOfPoint which does one gate.
I have 5 gates i want to do "Closed" and "Open".
I know how to do it via command so /close and /open but i want it automatically this time
Reply
#2

Create a Var for Get Gate Open or Close,

VarGates = 0; // 0 Close - 1 Open

In OnPlayerUpdate:

if(IsPlayerInRangeOfPoint(playerid, 10.0, X, -Y, Z))
{
if(VarGates == 0)
{
GatesOpen
}
if(VarGates == 1)
{
GatesClose
}
}

public GatesOpen()
{
MoveObject // Gate1 Open
MoveObject // Gate2 Open
return 1;
}

public GatesClose()
{
MoveObject // Gate1 Close
MoveObject // Gate2 Close
return 1;
}


Use the Timer for destroy Flood on MoveObject
Reply
#3

I want to do the command way.
I type the command then it opens the gate, starts the timer, and uses the "public" to close the gates
But, when i tried it i kept getting a load of errors
Reply
#4

Ahn, in you /Command Insert this:
SetTimer("CloseGates", 5000, 0);

Out of Comand this:
forward GatesClose();
public GatesClose()
{
MoveObject / /
MoveObject / /
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)