Ajuda
#7

pawn Код:
if (strcmp(cmd, "/beber", true) == 0) {
        new Float: HP;
        GetPlayerHealth(playerid, HP);
        if(HP >= 100)
            return SendClientMessage(playerid, -1, "Impossнvel executar tal aзгo, limite de vida exedido!");
        if (IsAtBar(playerid)) {
            if (PlayerInfo[playerid][pDorgado2] >= 70) {
                PlayerInfo[playerid][pDoenca] = 4;
                PlayerInfo[playerid][pDorgado2] = 0;
                SendClientMessage(playerid, COLOR_GRAD2, "* Vocк estб infectado com cirrose, vб atй um hospital se tratar !");
                return true;
            }
            if (PlayerDrunk[playerid] < 10) {
                if (PlayerInfo[playerid][pDoenca] == 4) return SendClientMessage(playerid, COLOR_GRAD2, "* Vocк estб com cirrose, vб atй um hospital se tratar !");

                new Float: health;
                new x_nr[32];
                x_nr = strtok(cmdtext, idx);
                if (!strlen(x_nr)) {
                    SendClientMessage(playerid, COLOR_WHITE, "|__________________[ Bar's Drinks ]__________________|");
                    SendClientMessage(playerid, COLOR_WHITE, "Use: /beber [Bebida]");
                    SendClientMessage(playerid, COLOR_GREY, "Nomes Vбlidos: Cerveja (R$3), Vodka (R$5), Whisky (R$10), Coca-Cola (R$2), Бgua (R$1)");
                    return true;
                }
                if (strcmp(x_nr, "Cerveja", true) == 0) {
                    if (PlayerInfo[playerid][pAge] < 0) return SendClientMessage(playerid, COLOR_WHITE, "BarMan - Vocк Nгo Tem 18 Anos ou mais Para Poder Beber.");

                    GivePlayerMoney(playerid, -3);
                    PlayerDrunk[playerid] += 1;
                    PlayerInfo[playerid][pDorgado2] += 2;
                    if (PlayerDrunk[playerid] >= 5) {
                        GameTextForPlayer(playerid, "~w~Voce Esta~n~~p~Tonto~n~~g~beba agua ou coca-cola", 3500, 1);
                    }
                    SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 3000);
                    ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
                    if (GetPlayerHealth(playerid, health) < 100) {
                        if (PlayerInfo[playerid][pAlcoholPerk] > 0) {
                            PlayerDrunk[playerid] += 1;
                            new hp = 2 * PlayerInfo[playerid][pAlcoholPerk];
                            hp += 15;
                            SetPlayerHealth(playerid, health + hp);
                        } else {
                            SetPlayerHealth(playerid, health + 15.0);
                        }
                    }
                } else if (strcmp(x_nr, "Vodka", true) == 0) {
                    if (PlayerInfo[playerid][pAge] < 0) return SendClientMessage(playerid, COLOR_WHITE, "BarMan - Vocк Nгo Tem 18 Anos ou mais Para Poder Beber.");

                    GivePlayerMoney(playerid, -5);
                    PlayerDrunk[playerid] += 2;
                    PlayerInfo[playerid][pDorgado2] += 2;
                    SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 3000);
                    ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
                    if (PlayerDrunk[playerid] >= 5) {
                        GameTextForPlayer(playerid, "~w~Voce Esta~n~~p~Tonto~n~~g~beba agua ou coca-cola", 3500, 1);
                    }
                    if (GetPlayerHealth(playerid, health) < 100) {
                        if (PlayerInfo[playerid][pAlcoholPerk] > 0) {
                            PlayerDrunk[playerid] += 1;
                            new hp = 2 * PlayerInfo[playerid][pAlcoholPerk];
                            hp += 25;
                            SetPlayerHealth(playerid, health + hp);
                        } else {
                            SetPlayerHealth(playerid, health + 25.0);
                        }
                    }
                } else if (strcmp(x_nr, "Whisky", true) == 0) {
                    if (PlayerInfo[playerid][pAge] < 0) return SendClientMessage(playerid, COLOR_WHITE, "BarMan - Vocк Nгo Tem 18 Anos ou mais Para Poder Beber");

                    GivePlayerMoney(playerid, -10);
                    PlayerDrunk[playerid] += 3;
                    PlayerInfo[playerid][pDorgado2] += 2;
                    SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 3000);
                    ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0);
                    if (PlayerDrunk[playerid] >= 5) {
                        GameTextForPlayer(playerid, "~w~Voce Esta~n~~p~Tonto~n~~g~beba agua ou coca-cola", 3500, 1);
                    }
                    if (GetPlayerHealth(playerid, health) < 100) {
                        if (PlayerInfo[playerid][pAlcoholPerk] > 0) {
                            PlayerDrunk[playerid] += 1;
                            new hp = 2 * PlayerInfo[playerid][pAlcoholPerk];
                            hp += 27;
                            SetPlayerHealth(playerid, health + hp);
                        } else {
                            SetPlayerHealth(playerid, health + 27.0);
                        }
                    }
                } else if (strcmp(x_nr, "Coca-Cola", true) == 0) {
                    GivePlayerMoney(playerid, -2);
                    if (GetPlayerHealth(playerid, health) < 100) {
                        if (PlayerInfo[playerid][pAlcoholPerk] > 0) {
                            PlayerDrunk[playerid] += 1;
                            new hp = 2 * PlayerInfo[playerid][pAlcoholPerk];
                            hp += 27;
                            SetPlayerHealth(playerid, health + hp);
                        } else {
                            SetPlayerHealth(playerid, health + 5.0);
                        }
                        SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) - 2300);
                        PlayerDrunk[playerid] = 0;
                        PlayerDrunkTime[playerid] = 0;
                        SetPlayerDrunkLevel(playerid, 0);
                    }
                } else if (strcmp(x_nr, "agua", true) == 0) {
                    GivePlayerMoney(playerid, -1);
                    if (GetPlayerHealth(playerid, health) < 100) {
                        if (PlayerInfo[playerid][pAlcoholPerk] > 0) {
                            PlayerDrunk[playerid] += 1;
                            new hp = 2 * PlayerInfo[playerid][pAlcoholPerk];
                            hp += 27;
                            SetPlayerHealth(playerid, health + hp);
                        }
                        SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) - 2300);
                        PlayerDrunk[playerid] = 0;
                        PlayerDrunkTime[playerid] = 0;
                        SetPlayerDrunkLevel(playerid, 0);
                    }
                } else return SendClientMessage(playerid, COLOR_WHITE, "BarMan - Nгo nгo vendemos essa bebida.");

                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "* %s bebeu um(a) %s.", sendername, x_nr);
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
            } else {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo pode beber mais, Vocк vai vomitar...!");
                SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + 3000);
                return true;
            }
        } else return SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo estб em um bar !");

        return true;
    }
Reply


Messages In This Thread
[AJUDA] /beber bugado - by ChacaL_DesodeirO - 24.05.2013, 19:30
Re: Ajuda - by SkullFire - 24.05.2013, 19:59
Re: Ajuda - by [THs]ShadoW - 24.05.2013, 21:12
Re: Ajuda - by ChacaL_DesodeirO - 24.05.2013, 23:39
Re: Ajuda - by Gii - 24.05.2013, 23:49
Re: Ajuda - by ChacaL_DesodeirO - 25.05.2013, 01:44
Re: Ajuda - by Gii - 25.05.2013, 01:48
Re: Ajuda - by ChacaL_DesodeirO - 25.05.2013, 01:55
Re: Ajuda - by ChacaL_DesodeirO - 25.05.2013, 02:00

Forum Jump:


Users browsing this thread: 1 Guest(s)