If you are in the left lane, which is next to the guard shack, and you attempt to pull out any white card that looks like a room key, and put it in the machine, the guard will say, "I got you." and make the gate go up.
Your friend up above was probably in the left lane, waved at the guard, and was allowed in, the guard thinking she was already checked into the hotel. Same on the exit. If you attempt to put a white card into the machine, the guard will say, "I got you." and let you pass.
I don't think many try to cheat the system, so the guards are fairly relaxed about checking everyone.