Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // das ist jetzt soziemlich alles von oben bis unten gepostet was in meinem lotto system ist
- forward ShowLotto();
- forward Lotto(number);
- new LottoTimer = 0;
- pLottoNr,
- format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
- PlayerInfo[playerid][pLottoNr] = 0;
- //================================================= 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;
- }
- format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new plname[MAX_PLAYER_NAME];
- if (LottoTimer > 0)
- LottoTimer--;
- if (LottoTimer == 1)
- {
- OOCOff(COLOR_WHITE, "[Lotto]: Die Super Ziehung wurde gestartet!");
- new rand = random(90);
- if(rand < 70) { rand += 3; }
- Lotto(rand);
- }
- else if (LottoTimer == 120)
- {
- format(string, sizeof(string), "Lotto: Die Lotterie Ziehung beginnt in 2 Minuten, Jackpot: %d", Jackpot);
- SendClientMessage(i,COLOR_YELLOW,string);
- SendClientMessage(i,COLOR_YELLOW,"Lotto: Gib /Lotto [Nummer] um einen Lotterie-Schein zu kaufen.");
- }
- else if (LottoTimer == 60)
- {
- format(string, sizeof(string), "Lotto: Die Lotterie Ziehung beginnt in 1 Minute, Jackpot: %d", Jackpot);
- SendClientMessage(i,COLOR_YELLOW,string);
- SendClientMessage(i,COLOR_YELLOW,"Lotto: Gib /Lotto [Nummer] um einen Lotterie-Schein zu kaufen.");
- }
- new lotto = PlayerInfo[targetid][pLottoNr];
- public ShowLotto()
- {
- LottoTimer = 180;
- OOCOff(COLOR_WHITE, "[Lotto]: Die Lotto Losziehung wurde automatisch gestartet!(3 Minuten)");
- }
- SetTimer( "ShowLotto" , 7200000, true );
- format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
- if( strcmp( key , "LottoNr" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLottoNr] = strval( val ); }
- if(strcmp(cmd, "/startlotto", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 21 || PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
- {
- LottoTimer = 180;
- OOCOff(COLOR_WHITE, "[Lotto]: Die Lotto Losziehung wurde automatisch gestartet!(3 Minuten)");
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Du bist kein Reporter!");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/lotto", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pLottoNr] > 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Du hast bereits ein Lotterielos !");
- return 1;
- }
- if(GetPlayerMoney(playerid) < 50)
- {
- SendClientMessage(playerid, COLOR_GREY, " Du brauchst $30 um ein Lotterielos kaufen zu können !");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, COLOR_WHITE,"Benutze: /lotto [nummer]");
- return 1;
- }
- new lottonr = strval(tmp);
- if(lottonr < 1 || lottonr > 100) { SendClientMessage(playerid, COLOR_GREY, " Deine Lotterienummer darf nicht unter 1 oder über 100 liegen!"); return 1; }
- format(string, sizeof(string), "* Du hast dir ein Lotterielos mit der Nummer: %d gekauft, viel Glück.", lottonr);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- GivePlayerMoney(playerid, - 30);
- Jackpot += 40;
- PlayerInfo[playerid][pLottoNr] = lottonr;
- }
- return 1;
- }
- format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
- new lotto = PlayerInfo[targetid][pLottoNr];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement