SA-MP Forums Archive
Automatic Closing Doors - 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)
+--- Thread: Automatic Closing Doors (/showthread.php?tid=387225)



Automatic Closing Doors - Finn707 - 23.10.2012

Hello!

I have a mapped Fire Station, but I need to script the garage door commands. I want to do it in a dialog, where you can control each door seperately. I want to have two choices when opening each door, whether to keep it open, or it to close 20 seconds later. How can I script it so the door will close 20 seconds after it has been opened?


Re: Automatic Closing Doors - tyler12 - 23.10.2012

Post in the correct section then someone may consider helping you.


Re: Automatic Closing Doors - Adil - 23.10.2012

pawn Код:
new DoorOpened;
forward CloseDoor();

    if(strcmp(string, "/opendoor", true) == 0)
    {
    if(DoorOpened == 1)
        {
             SendClientMessage(playerid, COLOR_RED, "The door is already opened");
             return 1;
        }
        DoorOpened = 1;
        SetTimer("CloseDoor", 20000, 0);
    }

public CloseDoor()
{
    MoveObject(....)
    DoorOpened = 0;
}
Post in the right section next time. Use the Script Request Thread.


Re: Automatic Closing Doors - Finn707 - 23.10.2012

I wasn't asking for it to be done, just was wanting to know how it CAN be done. Thanks though, +rep.