Drinks System problem..
#1

Hey.. I made a drinks system.. but I have a problem.. I added that if you order lets say beer so it adds you like 60 drunk points.. the problem that you get a bottle and if you drink from it then its add too much points.. I want that if you continue to drink you wont lose any drunk points... or less?
anyway.. here's what I got..

pawn Код:
if(strcmp(cmd, "/drunklevel", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(GetPlayerDrunkLevel(playerid) <= 500)
            {
                format(string, sizeof(string), "Drunk Level: %d",GetPlayerDrunkLevel(playerid));
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                return 1;
            }
            else
            {
                format(string, sizeof(string), "Drunk Level: %d (You already Drunk, You better rest a little)",GetPlayerDrunkLevel(playerid));
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                return 1;
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/order", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsAtBar(playerid))
            {
                for(new i; i < MAX_PLAYERS; i++)
                {
                GetPlayerName(i, sendername, sizeof(sendername));
                format(string, sizeof(string), "* %s Calls the bartender over and look at the list of drinks.", sendername);
                ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Drinks avliable tonight!!/n Remember to check your drunk level by /drunklevel", "Water($1) - 0% Alcohol \nSprunk($2) - 0% Alcohol \nSoda($2) - 0% Alcohol \nBeer($10) - 6% Alcohol \nWine($14) - 13% Alcohol \nChampagne($20) - 14% Alcohol \nPina Colada($28) - 14.5% Alcohol \nVodka($30) - 40% Alcohol \nWhiskey($35) - 40% Alcohol", "Order Drink", "Cancel Order");
                return 1;
                }
            }
        }
        return 1;
    }
pawn Код:
switch(dialogid)
        {
            case 2:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        if(GetPlayerDrunkLevel(playerid) <= 0)
                        {
                            GivePlayerMoney(playerid, - 1);
                            format(string, sizeof(string), "* %s Orders a glass of water and pays the bartender.", sendername);
                            ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            return 1;
                        }
                        else
                        {
                            GivePlayerMoney(playerid, - 1);
                            SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid)-20);
                            format(string, sizeof(string), "* %s Orders a glass of water and pays the bartender.", sendername);
                            ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            return 1;
                        }
                    }
                    case 1:
                    {
                        GivePlayerMoney(playerid, - 2);
                        format(string, sizeof(string), "* %s Orders a sprunk and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
                        return 1;
                    }
                    case 2:
                    {
                        GivePlayerMoney(playerid, - 2);
                        format(string, sizeof(string), "* %s Orders a glass of soda and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
                    case 3:
                    {
                        GivePlayerMoney(playerid, - 10);
                        SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid)+60);
                        format(string, sizeof(string), "* %s Orders a beer and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                        if(GetPlayerDrunkLevel(playerid) >= 500) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 4);}
                        return 1;
                    }
                    case 4:
                    {
                        GivePlayerMoney(playerid, - 14);
                        SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid)+130);
                        format(string, sizeof(string), "* %s Orders a bottle of wine and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
                        if(GetPlayerDrunkLevel(playerid) >= 500) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 4); }
                        return 1;
                    }
                    case 5:
                    {
                        GivePlayerMoney(playerid, - 20);
                        SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid)+140);
                        format(string, sizeof(string), "* %s Orders champagne and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
                        if(GetPlayerDrunkLevel(playerid) >= 500) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 4); }
                        return 1;
                    }
                    case 6:
                    {
                        GivePlayerMoney(playerid, - 28);
                        SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid)+145);
                        format(string, sizeof(string), "* %s Orders a cocktaile and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        if(GetPlayerDrunkLevel(playerid) >= 500) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 4); }
                        return 1;
                    }
                    case 7:
                    {
                        GivePlayerMoney(playerid, - 30);
                        SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid)+400);
                        format(string, sizeof(string), "* %s Orders bottle of vodka and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
                        if(GetPlayerDrunkLevel(playerid) >= 500) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 4); }
                        return 1;
                    }
                    case 8:
                    {
                        GivePlayerMoney(playerid, - 35);
                        SetPlayerDrunkLevel(playerid,GetPlayerDrunkLevel(playerid)+400);
                        format(string, sizeof(string), "* %s Orders bottle of whiskey and pays the bartender.", sendername);
                        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
                        if(GetPlayerDrunkLevel(playerid) >= 500) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 4); }
                        return 1;
                    }
                }
            }
        }

Thanks!
Reply
#2

You just asked the same thing in other topic why did you started another one?

Two guys answer your question and you didnt even thank them --'

This really pisses me off
Reply
#3

I asked another thing... I wanted to start a new topic cuz its about another problem?...............

and if i were continue ask there no one would help me.. as always...
i already used what they said.. even i made it alone...
but its another issue...?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)