Airport gate?
#1

how can I add airport gate that will open when you horn? i think that there should be one by default but there's nothing :X
Reply
#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
#3

nice, thanks, I just thought that I have some mistake in my files and that's why there are gates missing, :P did already gate in LV, going for SF now, also maybe you can help me with this: https://sampforum.blast.hk/showthread.php?tid=363633

looks like I have to do my very own lock system and don't use setvehicleparameters :X
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)