06.01.2014, 03:19
Quote:
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; } } |