[Tutorial] Moving Gate (Key, Manual, and Automatic) (More that 1 method)
#11

pawn Код:
//automatic

//Change the coordinate by yourself

#define FILTERSCRIPT

#include <a_samp>
#include <foreach>//Download this include if you don't have one

#define MAX_GATES 1

new Gate[MAX_GATES],
    bool:Open[MAX_GATES char];

new GateTimer[MAX_GATES];

forward GateMovement1();

public OnFilterScriptInit()
{
    Gate[0] = CreateObject(980,2044.09997559,1313.50000000,12.39999962,0.00000000,0.00000000,2.00000000);
    GateTimer[0] = SetTimer("GateMovement1",5000,1);
    return 1;
}

public GateMovement1()
{
    switch(Open{0})
    {
        case true:
        {
            foreach(Player,i)
            {
                if(IsPlayerInRangeOfPoint(i,10,2044.09997559,1313.50000000,12.39999962)) return 1;
            }
            MoveObject(Gate[0],2044.09997559,1313.50000000,6.39999962,1);
            Open{0} == false;
        }
        case false:
        {
            foreach(Player,i)
            {
                if(IsPlayerInRangeOfPoint(i,10,2044.09997559,1313.50000000,12.39999962))
                {
                    MoveObject(Gate[0],10,2044.09997559,1313.50000000,6.39999962,1);
                    Open{0} == true;
                    return 1;
                }
            }
        }
    }
    return 1;
}
Hmm , its not closing when it get opened ? What the problem ?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)