Limited air supply underwater

Version:

1.0

Added on:

03 Aug 2013 17:38

Tags:

Description:
Does what the title says. You can easily adjust the time it takes to drown to your liking by changing the p.timerStart() value.
void onPlayer() {
  if (p.yPos >= jjWaterLevel && p.timerState == TIMER::STOPPED) p.timerStart(30*70);
  if (p.yPos >= jjWaterLevel && p.timerTime == 5*70) jjAlert("You are drowning!");
  if (p.yPos < jjWaterLevel) p.timerStop();
}

void onPlayerTimerEnd() {
  p.kill();
  jjChat("/me forgot to come up for air");
}