Checking if no one's player-specific variable is equal to value
#3

Quote:
Originally Posted by IzadorO
View Post
Code:
for (new i = 0; i != MAX_PLAYERS; i ++)
{
      if (LottoNumber[i] != LottoNum) {
          SendClientMessage(i, COLOR_WHITE, "{FFFF00}LOTTO: Unfortunately you haven't won the lottery. Good luck next time!");
          continue;
      }
      // award player here
      break; // break here if you only want 1 lottery winner
}
I haven't slept so I'm just making this off the top of my head but this should be about right.
Doesn't work. I have the main thing set up (e.g. choosing a random number, player buys a ticket, sees who wins). However, I want it so that every time the lotto is drawn, there is ALWAYS a winner.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)