SA-MP Forums Archive
[Ajuda] limitar maximo de premio - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] limitar maximo de premio (/showthread.php?tid=499365)



limitar maximo de premio - AssasinoLM - 07.03.2014

Code:
public Lotto(number)
{
	new JackpotFallen = 0;
	format(gstring, sizeof(gstring), "Lotto: Hoje o nъmero Foi o {00FF00}%d{BFBFBF}.", number);
    OOCNews(0xBFBFBFAA, gstring);
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(PlayerInfo[i][pLottoNr] > 0)
		    {
			    if(PlayerInfo[i][pLottoNr] == number)
			    {
			        JackpotFallen = 1;
					format(gstring, sizeof(gstring), "Lotto: %s recebeu %d$ com o seu TICKET.", PlayerName(i), Jackpot);
					OOCNews(0xC0C0C0AA, gstring);
					SendClientMessage(i, COLOR_YELLOW, gstring);
					ConsumingMoney[i] = 1;
					GivePlayerMoneyEx(i, Jackpot);
			    }
			}
			PlayerInfo[i][pLottoNr] = 0;
		}
	}
	if(JackpotFallen)
	{
	    new rand = random(5000); rand += 5000;
	    Jackpot = rand;
	    SaveStuff();

		format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
		OOCNews(0xBFBFBFAA, gstring);
	}
	else
	{
	    new rand = random(5000); rand += 5000;
	    Jackpot += rand;
	    SaveStuff();
	    format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
		OOCNews(0xBFBFBFAA, gstring);
	}
	return 1;
}
como coloco maximo de 500k?


Re: limitar maximo de premio - PT - 07.03.2014

pawn Code:
if(Jackpot >= 500000)
    GivePlayerMoneyEx(i, 500000);
else GivePlayerMoneyEx(i, Jackpot);
agr adpte la.


Re: limitar maximo de premio - AssasinoLM - 07.03.2014

Quote:
Originally Posted by PT
View Post
pawn Code:
if(Jackpot >= 500000)
    GivePlayerMoneyEx(i, 500000);
else GivePlayerMoneyEx(i, Jackpot);
agr adpte la.
Code:
public Lotto(number)
{
	new JackpotFallen = 0;
	format(gstring, sizeof(gstring), "Lotto: Hoje o nъmero Foi o {00FF00}%d{BFBFBF}.", number);
    OOCNews(0xBFBFBFAA, gstring);
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(PlayerInfo[i][pLottoNr] > 0)
		    {
			    if(PlayerInfo[i][pLottoNr] == number)
			    {
			        JackpotFallen = 1;
					format(gstring, sizeof(gstring), "Lotto: %s recebeu %d$ com o seu TICKET.", PlayerName(i), Jackpot);
					OOCNews(0xC0C0C0AA, gstring);
					SendClientMessage(i, COLOR_YELLOW, gstring);
					ConsumingMoney[i] = 1;
					GivePlayerMoneyEx(i, 500000);
                                        else GivePlayerMoneyEx(i, Jackpot);
			    }
			}
			PlayerInfo[i][pLottoNr] = 0;
		}
	}
	if(Jackpot >= 500000)
	{
	    new rand = random(5000); rand += 5000;
	    Jackpot = rand;
	    SaveStuff();

		format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
		OOCNews(0xBFBFBFAA, gstring);
	}
	else
	{
	    new rand = random(5000); rand += 5000;
	    Jackpot += rand;
	    SaveStuff();
	    format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
		OOCNews(0xBFBFBFAA, gstring);
	}
	return 1;
}
assim?


Re: limitar maximo de premio - AssasinoLM - 08.03.2014

alguйm sabe me dizer?


Re: limitar maximo de premio - DannielCooper - 08.03.2014

Testa e depois posta.


Re: limitar maximo de premio - PT - 08.03.2014

epa vc quer tudo feito.. te dei a parte que vc tinha de mudar, mesmo assim.

pawn Code:
public Lotto(number)
{
    new JackpotFallen = 0;
    format(gstring, sizeof(gstring), "Lotto: Hoje o nъmero Foi o {00FF00}%d{BFBFBF}.", number);
    OOCNews(0xBFBFBFAA, gstring);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pLottoNr] > 0)
            {
                if(PlayerInfo[i][pLottoNr] == number)
                {
                    JackpotFallen = 1;
                    format(gstring, sizeof(gstring), "Lotto: %s recebeu %d$ com o seu TICKET.", PlayerName(i), Jackpot);
                    OOCNews(0xC0C0C0AA, gstring);
                    SendClientMessage(i, COLOR_YELLOW, gstring);
                    ConsumingMoney[i] = 1;
                    if(Jackpot >= 500000)
                        GivePlayerMoneyEx(i, 500000);
                    else GivePlayerMoneyEx(i, Jackpot);
                }
            }
            PlayerInfo[i][pLottoNr] = 0;
        }
    }
    if(Jackpot >= 500000)
    {
        new rand = random(5000); rand += 5000;
        Jackpot = rand;
        SaveStuff();

        format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
        OOCNews(0xBFBFBFAA, gstring);
    }
    else
    {
        new rand = random(5000); rand += 5000;
        Jackpot += rand;
        SaveStuff();
        format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
        OOCNews(0xBFBFBFAA, gstring);
    }
    return 1;
}



Re: limitar maximo de premio - AssasinoLM - 08.03.2014

Quote:
Originally Posted by PT
View Post
epa vc quer tudo feito.. te dei a parte que vc tinha de mudar, mesmo assim.

pawn Code:
public Lotto(number)
{
    new JackpotFallen = 0;
    format(gstring, sizeof(gstring), "Lotto: Hoje o nъmero Foi o {00FF00}%d{BFBFBF}.", number);
    OOCNews(0xBFBFBFAA, gstring);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pLottoNr] > 0)
            {
                if(PlayerInfo[i][pLottoNr] == number)
                {
                    JackpotFallen = 1;
                    format(gstring, sizeof(gstring), "Lotto: %s recebeu %d$ com o seu TICKET.", PlayerName(i), Jackpot);
                    OOCNews(0xC0C0C0AA, gstring);
                    SendClientMessage(i, COLOR_YELLOW, gstring);
                    ConsumingMoney[i] = 1;
                    if(Jackpot >= 500000)
                        GivePlayerMoneyEx(i, 500000);
                    else GivePlayerMoneyEx(i, Jackpot);
                }
            }
            PlayerInfo[i][pLottoNr] = 0;
        }
    }
    if(Jackpot >= 500000)
    {
        new rand = random(5000); rand += 5000;
        Jackpot = rand;
        SaveStuff();

        format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
        OOCNews(0xBFBFBFAA, gstring);
    }
    else
    {
        new rand = random(5000); rand += 5000;
        Jackpot += rand;
        SaveStuff();
        format(gstring, sizeof(gstring), "Lotto: Premio acumulado para {00FF00}%d{BFBFBF}.", Jackpot);
        OOCNews(0xBFBFBFAA, gstring);
    }
    return 1;
}
deu erro:

Code:
C:\Users\Leonardo Monteiro\Desktop\[head-samp] play online completo [head-samp] (1)\Servidor Online sitebpo.tk\gamemodes\RPG.pwn(4968) : warning 204: symbol is assigned a value that is never used: "JackpotFallen"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: limitar maximo de premio - GWMPT - 08.03.2014

warning nгo й erro

"symbol is assigned a value that is never used"
quer dizer, que a variavel JackpotFallen nunca й usada.


Re: limitar maximo de premio - AssasinoLM - 08.03.2014

Quote:
Originally Posted by Kikito
View Post
warning nгo й erro

"symbol is assigned a value that is never used"
quer dizer, que a variavel JackpotFallen nunca й usada.
traduzir e mole so ir no ****** agora saber resolver eu nгo sei!: (


Re: limitar maximo de premio - PT - 08.03.2014

apenas deleta isso:

pawn Code:
new JackpotFallen = 0;
e ve se estuda.