Rotating Objects (Gates)
#7

GATE OPEN
CreateObject(2920, 1534.39, -1602.27, 13.27, 0.00, 0.00, 89.94);

GATECLOSED
CreateObject(2920, 1534.39, -1602.27, 13.27, -90.60, 360.06, 89.94);

pawn Код:
new PDGate1


forward PDGateMove();


command(gate, playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 25.0, 1531.2126,-1603.6033,13.3828))
    {
        if(Player[playerid][Faction] == 1)
        {
            if(GateOpen == 0)
            {
                MoveDynamicObject(PDGate1, 1534.39, -1602.27, 13.27, 2.0, 0.0, 0.0, 89.94); // /gate opens the gate
                GateOpen = 1;
            }
            else
            {
                MoveDynamicObject(PDGate1, 1534.39, -1602.27, 13.27, 2.0, -90.60, 360.06, 89.94); // /gate closes the gate
                GateOpen = 0;
            }
        }
    }
        return 1;
}

stock LoadObjects() // loads the gate in the CLOSED position
{
    // SCPD Gates
    PDGate1 = CreateObject(2920, 1534.39,-1602.27,13.27,-90.60,360.06,89.94);
    return 1;
}

public PDGateMove() // moves the gate to the OPEN position when player does /gate
{
    MoveDynamicObject(PDGate1, 1534.39,-1602.27,13.27,0.00,0.00,89.94);
    return 1;
}
Like this?
Reply


Messages In This Thread
Rotating Objects (Gates) - by Luke_James - 26.08.2012, 16:41
Re: Rotating Objects (Gates) - by Luke_James - 27.08.2012, 13:20
Re: Rotating Objects (Gates) - by mrsamp - 27.08.2012, 13:40
Re: Rotating Objects (Gates) - by Ranama - 27.08.2012, 13:42
Re: Rotating Objects (Gates) - by mrsamp - 27.08.2012, 13:50
Re: Rotating Objects (Gates) - by Luke_James - 27.08.2012, 13:57
Re: Rotating Objects (Gates) - by Luke_James - 27.08.2012, 14:20

Forum Jump:


Users browsing this thread: 1 Guest(s)