Automatic Command Gates - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Automatic Command Gates (
/showthread.php?tid=185478)
Automatic Command Gates -
Ritchie999 - 24.10.2010
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
Re: Automatic Command Gates -
Bogdanovic - 24.10.2010
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
Re: Automatic Command Gates -
Ritchie999 - 24.10.2010
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
Re: Automatic Command Gates -
Bogdanovic - 24.10.2010
Ahn, in you /Command Insert this:
SetTimer("CloseGates", 5000, 0);
Out of Comand this:
forward GatesClose();
public GatesClose()
{
MoveObject / /
MoveObject / /
return 1;
}