While player.chat does work when you're debugging your best bet in this scenario would be to use echos, preferably at the top like so:
PHP Code:
function onActionServerSide() {
echo(this.name @ "triggered by: " @ player.account);
echo("Params: " @ params);
// other code follows
}
There's probably an error in your logic thats causing multiple triggers to occur, or the wrong one.
Hint: Your problem lies in your server-side players for loop.