SA-MP Forums Archive
[FilterScript] | Jeremy | - Automatic 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] | Jeremy | - Automatic Gates (/showthread.php?tid=497136)



| Jeremy | - Automatic Gates - JeremyPeterson - 25.02.2014

Introduction
Hey.It's me Jeremy Peterson.
This is my THIRD filterscript,it's a simple but useful 'AUTOMATIC GATES' System.When you go near it,it opens automatically,and so,it closes when you go a bit away from it.You can edit the radius,objects,gate speed e.t.c.
Let's move on...


Screenshots
When you a bit far


When you come closer(It's opening,if you wait,it will go into the ground,so you can pass through easily )


Download
PASTEBIN


Re: | Jeremy | - Automatic Gates - Omar55555 - 25.02.2014

i don't understand is the gates only at that place ?? i think there is couple of includes and filterscripts have more dynamic gate system, and the pictures doesn't show them opening :/, therefore if you did it it's simple and good.


Re: | Jeremy | - Automatic Gates - JeremyPeterson - 25.02.2014

If you look closely,you'll see that the gates are in different positions.
In picture 2,it's a little under the ground.I'm sorry I couldn't take a clear picture,I'll add another picture,once I'm home.
Secondly,about making your own gates.Easy - Just replace the CREATEOBJECT code with your own,and replace the coordinates with your own.See below,for more info.
pawn Code:
forward TGate1();
public TGate1()
{
        new gateopen;
    if(!gateopen)
    MoveObject(Gate1, -838.46210, 2742.37427, 46.26330, 3); // THE OBJECTS POSITION WHEN IT'S CLOSED
        gateopen = 0;
        for(new i=GetMaxPlayers(); i > -1; i--)
    {
        if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 5.0, -843.3140, 2738.1877, 44.7193))
        {
            gateopen = 1;
            MoveObject(Gate1, -838.4621, 2742.3743, 42.2823, 3); // OBJECTS POSITION WHEN IT'S OPENED
            break;
        }
    }
}