05.12.2013, 04:27
You need the exact float value, so the above will only work once.
EDIT: I would recommend using a new variable that determines whether the doors are open or not, rather than getting the position of the object and checking it against the values given.
pawn Code:
new Float:X, Float:Y, Float:Z;
GetObjectPos(leftSdDoor, X, Y, Z);
if(X == 244.8868 && Y == 72.5878 && Z == 1002.6395)
{
//Doors closed
MoveObject(leftSdDoor, 243.9668, 72.5878, 1002.6395, 2.00);
MoveObject(rightSdDoor, 248.8093, 72.5921, 1002.6395, 2.00);
}
else
{
//Doors Open
MoveObject(leftSdDoor, 244.8868, 72.5878, 1002.6395, 2.00);
MoveObject(rightSdDoor, 247.8693, 72.5921, 1002.6395, 2.00);
}