Airport gate?
#2

If you mean at the LS Airport, then I made this little script for you, tested it ingame and it works!
As to how I made it, you need to use some sort of mapping program, a good one I recommend is JernejL's MapEditor.
After you put the object, and acquire coordinates, everything else comes down to scripting.
pawn Код:
#define FILTERSCRIPT
#include <a_samp>

forward CloseAirportGate();

new LSAirportGateA, LSAirportGateB, bool:AirportGateStatus;

public OnFilterScriptInit()
{
    LSAirportGateA = CreateObject(988, 1964.342, -2189.776, 13.533, 0.0, 0.0, 180.0);
    LSAirportGateB = CreateObject(988, 1958.851, -2189.777, 13.553, 0.0, 0.0, 180.0);
   
    return true;
}

public OnFilterScriptExit()
{
    DestroyObject(LSAirportGateA);
    DestroyObject(LSAirportGateB);
   
    return true;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if (IsPlayerInRangeOfPoint(playerid, 10.0, 1961.389, -2189.856, 13.553))
        {
            if (newkeys & KEY_CROUCH)
            {
                if (AirportGateStatus == false)
                {
                    AirportGateStatus = true;
                   
                    MoveObject(LSAirportGateA, 1968.697, -2189.776, 13.553, 5.0);
                    MoveObject(LSAirportGateB, 1954.571, -2189.777, 13.553, 5.0);
                }
            }
        }
    }
   
    return true;
}

public OnObjectMoved(objectid)
{
    if (objectid == LSAirportGateA)
    {
        if (AirportGateStatus)
            SetTimer("CloseAirportGate", 1000, false);
    }
   
    return true;
}

public CloseAirportGate()
{
    MoveObject(LSAirportGateA, 1964.342, -2189.776, 13.533, 5.0);
    MoveObject(LSAirportGateB, 1958.851, -2189.777, 13.553, 5.0);
   
    AirportGateStatus = false;
}
Reply


Messages In This Thread
Airport gate? - by SEnergy - 28.07.2012, 13:05
Re: Airport gate? - by Virtual1ty - 28.07.2012, 13:45
Re: Airport gate? - by SEnergy - 28.07.2012, 14:25

Forum Jump:


Users browsing this thread: 1 Guest(s)