19.05.2012, 10:20
It won't make it any more complicated. Actually you have made your code very complicated by using cases way too much:
pawn Код:
switch(Open{0})//Check whether the gate opened or closed
{
case true://If the gate opened
{
MoveObject(LSPDdoor, 2245.50000000,72.59999847,1002.59997559, 5);
Open{0} = false;
}
case false://If the gate closed
{
MoveObject(LSPDdoor, 244.00000000,72.59999847,1002.59997559, 5);
SetTimerEx("LSPDClose", 3500, false, "i", playerid);
Open{0} = true;
}
}
pawn Код:
if(Open{0})//Check whether the gate opened or closed
{
MoveObject(LSPDdoor, 2245.50000000,72.59999847,1002.59997559, 5);
Open{0} = false;
}
else
{
MoveObject(LSPDdoor, 244.00000000,72.59999847,1002.59997559, 5);
SetTimerEx("LSPDClose", 3500, false, "i", playerid);
Open{0} = true;
}