Check if object fully closed or opened
#2

You can add a timer for how long the gate takes to open, example if it takes 1/2 seconds for the gate to open make a timer for 1 / 2 seconds, add a variable like this to remember.

Код:
new gateOpen;

if(gateOpen == 1)
{
    add here the code to happen if the gate is opened fully
    gateOpen = 2;
}
if(gateOpen == 2)
{
  add here what to happen if the gate is opening... in the process to open
  SendClientMessage(playerid, -1, "The gate is opening... please way.");
  SetTimerEx("gateOpenTimer", 2000, false, "i", playerid);//the timer
}
if(gateOpen == 0)
{
  add here to happen if the gate is closed.
  gateOpen = 2;
}


forward gateopentimer(playerid);
public gateopentimer
{
   gateOpen = 0;
   This will happen when the gate fully opened or closed.
}
Not sure if it will work well, you have to modify it a bit to suit your system and work for everyone that tries the .
You will need few more variables for it to work well but I gave you an idea.
Reply


Messages In This Thread
Check if object fully closed or opened - by MerryDeer - 20.01.2017, 03:32
Re: Check if object fully closed or opened - by AndreiWow - 20.01.2017, 03:58
Re: Check if object fully closed or opened - by MerryDeer - 20.01.2017, 04:04
Re: Check if object fully closed or opened - by Nate4 - 20.01.2017, 04:19
Re: Check if object fully closed or opened - by Sew_Sumi - 20.01.2017, 04:31
Re: Check if object fully closed or opened - by Nate4 - 20.01.2017, 04:39
Re: Check if object fully closed or opened - by Sew_Sumi - 20.01.2017, 04:42

Forum Jump:


Users browsing this thread: 1 Guest(s)