25.07.2012, 17:59
I put this disclaimer on top...
The array thing way easier to use if you understand how it works
----
If I compare your code and the code in the tutorial the open variable is missing
Quote:
If you want to use an array, it could look like that
But you shouldnt use that code if you dont understand it |
----
If I compare your code and the code in the tutorial the open variable is missing
pawn Код:
public AutoTor() {
new
bool: openArmyGate1,
bool: openArmyGate2
;
for(new i; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(!openArmyGate1 && IsPlayerInRangeOfPoint( i, 15, 286.03, 1820.46, 19.94)) {
openArmyGate1 = true;
}
else if(!openArmyGate2 && IsPlayerInRangeOfPoint( i, 15, 134.92, 1941.57, 21.64)) {
openArmyGate2 = true;
}
}
}
if(openArmyGate1) {
MoveObject(ArmyGate1, 286.03, 1833.72, 19.94, 3, 0.00, 0.00, 90.00);
} else {
MoveObject(ArmyGate1, 286.03, 1820.46, 19.94, 3, 0.00, 0.00, 90.00);
}
if(openArmyGate2) {
MoveObject(ArmyGate2, 120.84, 1941.57, 21.62, 3, 0.00, 0.00, 0.00);
} else {
MoveObject(ArmyGate2, 134.92, 1941.57, 21.64, 3, 0.00, 0.00, 0.00);
}
}