Advertisement
sparkychild

Untitled

Jul 20th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. case 'leave':
  2. if (gameStatus[room] !== 'signup') return false;
  3. if (playerData[room][toId(by)]) {
  4. //re-make playerlist
  5. var pIndex = playerCount[room].indexOf(toId(by));
  6. var pushPlayer = [];
  7. for(var x = 0; x < playerCount[room].length; x++){
  8. if(x === pIndex){
  9. continue;
  10. }
  11. pushPlayer.push(playerCount[room][x]);
  12. }
  13. //reset playerlist
  14. playerCount[room] = pushPlayer;
  15. this.say(',' + by, 'Aww, next time then!')
  16. }
  17. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement