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;
}
MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed);
pawn Код:
|
of course you can, use this:
https://sampwiki.blast.hk/wiki/MoveObject or this: MoveDynamicObject( objectid, Float ![]() ![]() ****** is your friend ![]() |
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;
}