Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //================================================= Lotto ==========================================
- public Lotto(number)
- {
- new JackpotFallen = 0;
- new string[256];
- new winner[MAX_PLAYER_NAME];
- format(string, sizeof(string), "Lotto: Heute wurde die Losnummer %d gezogen.", number);
- OOCOff(COLOR_WHITE, string);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][pLottoNr] > 0)
- {
- if(PlayerInfo[i][pLottoNr] == number)
- {
- JackpotFallen = 1;
- GetPlayerName(i, winner, sizeof(winner));
- format(string, sizeof(string), "Lotto: %s hat den Jackpot von $%d gewonnen.", winner, Jackpot);
- OOCOff(COLOR_WHITE, string);
- format(string, sizeof(string), "* Du hast $%d mit deinem Lottoticket gewonnen.", Jackpot);
- SendClientMessage(i, COLOR_YELLOW, string);
- ConsumingMoney[i] = 1;
- GivePlayerMoney(i, Jackpot);
- }
- else
- {
- SendClientMessage(i, COLOR_LIGHTBLUE, "Du hast beim Lotto nicht gewonnen.");
- }
- }
- PlayerInfo[i][pLottoNr] = 0;
- }
- }
- if(JackpotFallen)
- {
- new rand = random(10000); rand += 15000;
- Jackpot = rand;
- SaveStuff();
- format(string, sizeof(string), "Lotto: Der neue Jackpot beträgt $%d.", Jackpot);
- OOCOff(COLOR_WHITE, string);
- }
- else
- {
- new rand = random(500); rand += 1000;
- Jackpot += rand;
- SaveStuff();
- format(string, sizeof(string), "Lotto: Der Jackpot wurde auf $%d erhöht.", Jackpot);
- OOCOff(COLOR_WHITE, string);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement