07.05.2013, 16:02
Hi, when I use the command /pdgate, the gate will open but when I type it again it does not close, it just moves a little bit... Here's the code;
The co-ordinate for the OPEN gate is;
- CreateObject(968, -1572.19006, 658.84747, 6.93702, 0.00000, 0.00000, -90.90003);
The co-ordinate for the CLOSED gate is;
- CreateObject(968, -1572.20239, 658.68304, 7.09238, 1.85999, -91.07996, -89.70003);
NOTE: The indentation is done properly on the actual script, it messed up a little here.
pawn Код:
new PDGate1
stock LoadObjects()
{
PDGate1 = CreateDynamicObject(968, -1572.20239,658.68304,7.09238,1.85999,-91.07996,-89.70003);
return 1;
}
public PDGateMove()
{
MoveDynamicObject(PDGate1, -1572.19006,658.84747,6.93702,0.00,0.00,00.00);
return 1;
}
command(pdgate, playerid, params[])
{
if(Player[playerid][Faction] == 1)
{
if(GateOpen == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 25.0, -1572.20239, 658.68304, 7.09238 ))
{
MoveDynamicObject(PDGate1, -1572.19006, 658.84747, 6.93702, 2.0, 0.0, 0.0, 0.0);
}
GateOpen = 1;
}
else
{
if(IsPlayerInRangeOfPoint(playerid, 25.0, -1572.20239, 658.68304, 7.09238 ))
{
MoveDynamicObject(PDGate1, -1572.20239, 658.68304, 7.09238, 2.0, -0.00, 0.00, 0.00);
}
GateOpen = 0;
}
}
return 1;
}
- CreateObject(968, -1572.19006, 658.84747, 6.93702, 0.00000, 0.00000, -90.90003);
The co-ordinate for the CLOSED gate is;
- CreateObject(968, -1572.20239, 658.68304, 7.09238, 1.85999, -91.07996, -89.70003);
NOTE: The indentation is done properly on the actual script, it messed up a little here.