[AJUDA] Criar loterica
#3

pawn Код:
//LOTERICA
new roubolot;
new ProvocoLot[MAX_PLAYERS];
new tempolot;
forward RouboLot(playerid);

//Se Quizer por no /gps Pega a Coordernada ai
SetPlayerCheckpoint(playerid, 1631.8547,-1172.5637,24.0843,8.0);//Loterica

//Coloca na Public ai
public ClearFishes(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        Fishes[playerid][pFid1] = 0; Fishes[playerid][pFid2] = 0; Fishes[playerid][pFid3] = 0;
        Fishes[playerid][pFid4] = 0; Fishes[playerid][pFid5] = 0;
        Fishes[playerid][pWeight1] = 0; Fishes[playerid][pWeight2] = 0; Fishes[playerid][pWeight3] = 0;
        Fishes[playerid][pWeight4] = 0; Fishes[playerid][pWeight5] = 0;
        new string[MAX_PLAYER_NAME];
        format(string, sizeof(string), "Nenhum");
        strmid(Fishes[playerid][pFish1], string, 0, strlen(string), 255);
        strmid(Fishes[playerid][pFish2], string, 0, strlen(string), 255);
        strmid(Fishes[playerid][pFish3], string, 0, strlen(string), 255);
        strmid(Fishes[playerid][pFish4], string, 0, strlen(string), 255);
        strmid(Fishes[playerid][pFish5], string, 0, strlen(string), 255);
    }
    return 1;
}

public ClearFishID(playerid, fish)
{
    if(IsPlayerConnected(playerid))
    {
        new string[MAX_PLAYER_NAME];
        format(string, sizeof(string), "Nenhum");
        switch (fish)
        {
            case 1:
            {
                strmid(Fishes[playerid][pFish1], string, 0, strlen(string), 255);
                Fishes[playerid][pWeight1] = 0;
                Fishes[playerid][pFid1] = 0;
            }
            case 2:
            {
                strmid(Fishes[playerid][pFish2], string, 0, strlen(string), 255);
                Fishes[playerid][pWeight2] = 0;
                Fishes[playerid][pFid2] = 0;
            }
            case 3:
            {
                strmid(Fishes[playerid][pFish3], string, 0, strlen(string), 255);
                Fishes[playerid][pWeight3] = 0;
                Fishes[playerid][pFid3] = 0;
            }
            case 4:
            {
                strmid(Fishes[playerid][pFish4], string, 0, strlen(string), 255);
                Fishes[playerid][pWeight4] = 0;
                Fishes[playerid][pFid4] = 0;
            }
            case 5:
            {
                strmid(Fishes[playerid][pFish5], string, 0, strlen(string), 255);
                Fishes[playerid][pWeight5] = 0;
                Fishes[playerid][pFid5] = 0;
            }
        }
    }
    return 1;
}

public ClearCooking(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        Cooking[playerid][pCookID1] = 0; Cooking[playerid][pCookID2] = 0; Cooking[playerid][pCookID3] = 0;
        Cooking[playerid][pCookID4] = 0; Cooking[playerid][pCookID5] = 0;
        Cooking[playerid][pCWeight1] = 0; Cooking[playerid][pCWeight2] = 0; Cooking[playerid][pCWeight3] = 0;
        Cooking[playerid][pCWeight4] = 0; Cooking[playerid][pCWeight5] = 0;
        new string[MAX_PLAYER_NAME];
        format(string, sizeof(string), "Nenhum");
        strmid(Cooking[playerid][pCook1], string, 0, strlen(string), 255);
        strmid(Cooking[playerid][pCook2], string, 0, strlen(string), 255);
        strmid(Cooking[playerid][pCook3], string, 0, strlen(string), 255);
        strmid(Cooking[playerid][pCook4], string, 0, strlen(string), 255);
        strmid(Cooking[playerid][pCook5], string, 0, strlen(string), 255);
    }
    return 1;
}

public ClearCookingID(playerid, cook)
{
    if(IsPlayerConnected(playerid))
    {
        new string[MAX_PLAYER_NAME];
        format(string, sizeof(string), "Nenhum");
        switch (cook)
        {
            case 1:
            {
                strmid(Cooking[playerid][pCook1], string, 0, strlen(string), 255);
                Cooking[playerid][pCWeight1] = 0;
                Cooking[playerid][pCookID1] = 0;
            }
            case 2:
            {
                strmid(Cooking[playerid][pCook2], string, 0, strlen(string), 255);
                Cooking[playerid][pCWeight2] = 0;
                Cooking[playerid][pCookID2] = 0;
            }
            case 3:
            {
                strmid(Cooking[playerid][pCook3], string, 0, strlen(string), 255);
                Cooking[playerid][pCWeight3] = 0;
                Cooking[playerid][pCookID3] = 0;
            }
            case 4:
            {
                strmid(Cooking[playerid][pCook4], string, 0, strlen(string), 255);
                Cooking[playerid][pCWeight4] = 0;
                Cooking[playerid][pCookID4] = 0;
            }
            case 5:
            {
                strmid(Cooking[playerid][pCook5], string, 0, strlen(string), 255);
                Cooking[playerid][pCWeight5] = 0;
                Cooking[playerid][pCookID5] = 0;
            }
        }
    }
    return 1;
}

public ClearGroceries(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        Groceries[playerid][pChickens] = 0; Groceries[playerid][pChicken] = 0;
        Groceries[playerid][pHamburgers] = 0; Groceries[playerid][pHamburger] = 0;
        Groceries[playerid][pPizzas] = 0; Groceries[playerid][pPizza] = 0;
    }
    return 1;
}

public Lotto(number)
{
    new JackpotFallen = 0;
    format(gstring, sizeof(gstring), "Loterica: Hoje o numero sorteado foi o nє %d.", number);
    OOCNews(COLOR_WHITE, 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), "Loterica: %s ganhou R$%d com seu bilhete.", PlayerName(i), Jackpot);
                    OOCNews(COLOR_WHITE, gstring);
                    format(gstring, sizeof(gstring), "* Vocк ganhou R$%d com seu bilhete de loteria.", Jackpot);
                    SendClientMessage(i, COLOR_YELLOW, gstring);
                    ConsumingMoney[i] = 1;
                    GivePlayerMoney(i, Jackpot);
                }
                else
                {
                    SendClientMessage(i, COLOR_GREY, " Vocк nгo tem um bilhete.");
                }
            }
            PlayerInfo[i][pLottoNr] = 0;
        }
    }
    if(JackpotFallen)
    {
        new rand = random(125000); rand += 15789;
        Jackpot = rand;
        SaveStuff();
        format(gstring, sizeof(gstring), "Loterica: O prкmio acumulou para: R$%d.", Jackpot);
        OOCNews(COLOR_WHITE, gstring);
    }
    else
    {
        new rand = random(15000); rand += 2158;
        Jackpot += rand;
        SaveStuff();
        format(gstring, sizeof(gstring), "Loterica: O prкmio acumulou para: R$%d.", Jackpot);
        OOCNews(COLOR_WHITE, gstring);
    }
    return 1;
}

            //Loterica entrada
                SetPlayerPos(playerid, 832.6270,7.2666,1004.1797);
                GameTextForPlayer(playerid, "~w~Loterica BVE",5000,1);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerInterior(playerid,3);
                SetPlayerFacingAngle(playerid, 0);
                PlayerInfo[playerid][pInt] = 3;

            //Loterica saida
                SetPlayerPos(playerid, 1631.8547,-1172.5637,24.084);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerInterior(playerid,0);
                SetPlayerFacingAngle(playerid, 0);
                PlayerInfo[playerid][pInt] = 0;
                PlayerInfo[playerid][pLocal] = 255;
            }

//loterica
                GameTextForPlayer(i, "~w~Digite /loteria para comprar um bilhete!", 5000, 5);
            }
            else if(PlayerToPoint(3.0, i,256.0320,84.5082,1002.4453))
            {
                if (PlayerInfo[i][pMembro] == 24 || PlayerInfo[i][pLider] == 24)
                {
                    GameTextForPlayer(i, "~g~PAGUE 5K e, ~n~ ~w~ | Digite ~y~/autorizacao |", 5000, 5);
                }
            }
Tenta ai se vocк souber por de boa
Reply


Messages In This Thread
[AJUDA] Criar loterica - by Renato_Silva - 16.10.2011, 00:12
Re: [AJUDA] Criar loterica - by Renato_Silva - 16.10.2011, 17:12
Re: [AJUDA] Criar loterica - by Laercio - 16.10.2011, 17:18
Re: [AJUDA] Criar loterica - by Josma_cmd - 16.10.2011, 17:19
Re: [AJUDA] Criar loterica - by Renato_Silva - 17.10.2011, 11:58
Re: [AJUDA] Criar loterica - by Lуs - 17.10.2011, 13:36
Re: [AJUDA] Criar loterica - by Renato_Silva - 17.10.2011, 13:53
Re: [AJUDA] Criar loterica - by Lуs - 17.10.2011, 15:13
Re: [AJUDA] Criar loterica - by Renato_Silva - 17.10.2011, 17:42
Re: [AJUDA] Criar loterica - by Renato_Silva - 17.10.2011, 18:46

Forum Jump:


Users browsing this thread: 4 Guest(s)