Airport Security
#3

Quote:
Originally Posted by BlackSirrah239
Посмотреть сообщение
Check out this wiki page https://sampwiki.blast.hk/wiki/SetTimer if you haven't already.
From what I see, your code will open the gate but not close it. To close it, add another timer after MoveDynamicObject and lead it to another public method moving it back to it's original location, or use a global boolean to check if it is open or closed and toggle that. Note that you will need to add another timer in to close it, something like this could work:
Код:
public AirportGate()
{
	if(!GateOpened)
	{
		MoveDynamicObject(1095, 0.0, 0.0, 0.0, 1, 90.0, 0.0, 0.0); //opened location
		SetTimer("AirportGate", 6000, false);
		GateOpened = true;
	}
	else
	{
		MoveDynamicObject(1095, 0.0, 0.0, 0.0, 1, 90.0, 0.0, 0.0); //closed location
		GateOpened = false;
	}
}
Yea I did look at the wiki post about it, didn't help much. But reading yours I do see it a lot better. I also ask, how would I get the id of the object, new to the public making and this part of it all.
Reply


Messages In This Thread
Airport Security - by KtotheYle - 05.01.2014, 17:44
Re: Airport Security - by BlackSirrah239 - 06.01.2014, 03:03
Re: Airport Security - by KtotheYle - 06.01.2014, 03:19
Re: Airport Security - by BlackSirrah239 - 06.01.2014, 04:00
Re: Airport Security - by KtotheYle - 06.01.2014, 21:39
Re: Airport Security - by BlackSirrah239 - 07.01.2014, 03:02
Re: Airport Security - by KtotheYle - 07.01.2014, 12:26

Forum Jump:


Users browsing this thread: 2 Guest(s)