Rotating Objects (Gates)
#1

Apparently I need to add the rotation co-ordinates in, but I'm not sure where'd they go. Do they get substituted in where the 2.0 co-ordinates are? If I just add them in after X, Y and Z then I just get a compiling error, (arguments do not match the definition or something).

Here's the pawno & the co-ordinates;

pawn Код:
new PDGate1, PDGate2


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.23, -1602.30, 13.40, 2.0, 0.0, 0.0, 0.0); // open
                MoveDynamicObject(PDGate2, 1534.40, -1724.08, 13.39, 2.0, 0.0, 0.0, 0.0); // open
                PlayerPlaySound(playerid, 1035, 0, 0, 0);
                GateOpen = 1;
            }
            else
            {
                MoveDynamicObject(PDGate1, 1534.34, -1602.28, 13.40, 2.0, 0.0, 0.0, 0.0); // closed
                MoveDynamicObject(PDGate2, 1534.60, -1724.08, 13.39, 2.0, 0.0, 0.0, 0.0); // closed
                GateOpen = 0;
            }
        }
    }
        return 1;
}

stock LoadObjects()
{
    // SCPD Gates
    PDGate1 = CreateDynamicObject(2920, 1534.34, -1602.28, 13.40,   -92.16, -2.04, 88.62);
        PDGate2 = CreateDynamicObject(2920, 1534.60, -1724.08, 13.39,  -91.62, 1.56, 91.62);
    return 1;
}

public PDGateMove()
{
    MoveDynamicObject(PDGate1, 1534.23, -1602.30, 13.40, 2.0, 0.0, 0.0, 0.0);
    MoveDynamicObject(PDGate2, 1534.40, -1724.08, 13.39, 2.0, 0.0, 0.0, 0.0);
    return 1;
}
Co-ordinates

PDGate1

Open: CreateObject(2920, 1534.23, -1602.30, 13.40, 0.00, 0.00, 87.24);
Closed: CreateObject(2920, 1534.34, -1602.28, 13.40, -92.16, -2.04, 88.62);

PDGate2

Open: CreateObject(2920, 1534.40, -1724.08, 13.39, 0.00, 0.00, 91.62);
Closed: CreateObject(2920, 1534.60, -1724.08, 13.39, -91.62, 1.56, 91.62);
Reply
#2

Bump
Reply
#3

pawn Код:
MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed);
Reply
#4

Quote:
Originally Posted by mrsamp
Посмотреть сообщение
pawn Код:
MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed);
of course you can, use this:
https://sampwiki.blast.hk/wiki/MoveObject

or this:
MoveDynamicObject( objectid, Float, Float:y, Float:z, Floatpeed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0 );

****** is your friend
Reply
#5

Quote:
Originally Posted by Ranama
Посмотреть сообщение
of course you can, use this:
https://sampwiki.blast.hk/wiki/MoveObject

or this:
MoveDynamicObject( objectid, Float, Float:y, Float:z, Floatpeed, Float:rX = -1000.0, Float:rY = -1000.0, Float:rZ = -1000.0 );

****** is your friend
I used ****** u mofo.... -.-
Reply
#6

So, how would I make my gate move using that then, with the given co-ordinates?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)