Jump to content
  • 0

Problema comanda /drink !


AlyN.

Question

3 answers to this question

Recommended Posts

[pawn]

if(strcmp(cmd, "/drink", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerToPoint(10.0,playerid,COORDONATELE X Y Z ))

{

            if(PlayerDrunk[playerid] < 10)

            {

                new Float:health;

                new x_nr[256];

x_nr = strtok(cmdtext, idx);

if(!strlen(x_nr)) {

SendClientMessage(playerid, COLOR_WHITE, "|____________________ Bar Drinks ______________________|");

SendClientMessage(playerid, COLOR_WHITE, "USAGE: /drink [drinkname]");

  SendClientMessage(playerid, COLOR_GREY, "Bautura fara alcool: Apa ($1), Suc($2)");

  SendClientMessage(playerid, COLOR_GREY, "Bautura Ieftina: Bere ($6), Vin($8), Sampanie($12)");

  SendClientMessage(playerid, COLOR_GREY, "Bautura Scumpa: Votca ($16), Cristal($20)");

  SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Warning! Excessive Drinking Causes Liver Damage");

SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________________|");

return 1;

}

    if(strcmp(x_nr,"bere",true) == 0)

{

if(PlayerInfo[playerid]


< 18)

{

    SendClientMessage(playerid, COLOR_WHITE, "Bartender: Imi pare rau dar nu iti pot oferi aceasta bautura daca nu ai peste 18 ani.");

    return 1;

}

    GivePlayerMoney(playerid, - 6);

    PlayerDrunk[playerid] += 1;

if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }

GetPlayerHealth(playerid, health);

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);

if(health < 100)

{

    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 10; SetPlayerHealth(playerid, health + hp); }

else { SetPlayerHealth(playerid, health + 10.0); }

}

GetPlayerName(playerid, sendername, sizeof(sendername));

                        format(string, sizeof(string), "* %s comanda o sticla de bere* ", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

else if(strcmp(x_nr,"vin",true) == 0)

{

    if(PlayerInfo[playerid]


< 18)

{

    SendClientMessage(playerid, COLOR_WHITE, "Barman: Imi pare rau dar nu iti pot oferi aceasta bautura daca nu ai peste 18 ani.");

    return 1;

}

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);

    GivePlayerMoney(playerid, - 8);

    PlayerDrunk[playerid] += 2;

if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }

GetPlayerHealth(playerid, health);

if(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); }

}

GetPlayerName(playerid, sendername, sizeof(sendername));

                        format(string, sizeof(string), "* %s comanda o sticla de vin* ", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

else if(strcmp(x_nr,"sampanie",true) == 0)

{

    if(PlayerInfo[playerid]


< 18)

{

    SendClientMessage(playerid, COLOR_WHITE, "Barman: Imi pare rau dar nu iti pot oferi aceasta bautura daca nu ai peste 18 ani.");

    return 1;

}

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);

    GivePlayerMoney(playerid, - 12);

    PlayerDrunk[playerid] += 2;

if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }

GetPlayerHealth(playerid, health);

if(health < 100)

{

    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 20; SetPlayerHealth(playerid, health + hp); }

else { SetPlayerHealth(playerid, health + 20.0); }

}

GetPlayerName(playerid, sendername, sizeof(sendername));

                        format(string, sizeof(string), "* %s comanda o sticla de sampanie* ", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

                    else if(strcmp(x_nr,"votca",true) == 0)

{

    if(PlayerInfo[playerid]


< 18)

{

    SendClientMessage(playerid, COLOR_WHITE, "Barman: Imi pare rau dar nu iti pot oferi aceasta bautura daca nu ai peste 18 ani.");

    return 1;

}

    GivePlayerMoney(playerid, - 16);

    PlayerDrunk[playerid] += 3;

    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);

if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }

GetPlayerHealth(playerid, health);

if(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); }

}

GetPlayerName(playerid, sendername, sizeof(sendername));

                        format(string, sizeof(string), "* %s comanda o sticla de votca* ", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

                    else if(strcmp(x_nr,"cristal",true) == 0)

{

    if(PlayerInfo[playerid]


< 18)

{

    SendClientMessage(playerid, COLOR_WHITE, "Barman: Barman: Imi pare rau dar nu iti pot oferi aceasta bautura daca nu ai peste 18 ani.");

    return 1;

}

    GivePlayerMoney(playerid, - 20);

    PlayerDrunk[playerid] += 4;

    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);

if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 1); }

GetPlayerHealth(playerid, health);

if(health < 100)

{

    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 40; SetPlayerHealth(playerid, health + hp); }

else { SetPlayerHealth(playerid, health + 40.0); }

}

GetPlayerName(playerid, sendername, sizeof(sendername));

                        format(string, sizeof(string), "* %s comanda un pahar de cristal* ", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

else if(strcmp(x_nr,"apa",true) == 0)

{

    GivePlayerMoney(playerid, - 1);

GetPlayerHealth(playerid, health);

    if(health < 100)

{

    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }

else { SetPlayerHealth(playerid, health + 50.0); }

}

else if(health > 100)

{

    SetPlayerHealth(playerid, 100);

}

GetPlayerName(playerid, sendername, sizeof(sendername));

                        format(string, sizeof(string), "* %s comanda o sticla cu apa* ", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

else if(strcmp(x_nr,"suc",true) == 0)

{

    GivePlayerMoney(playerid, - 2);

GetPlayerHealth(playerid, health);

SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);

    if(health < 100)

{

    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }

else { SetPlayerHealth(playerid, health + 50.0); }

}

else if(health > 100)

{

    SetPlayerHealth(playerid, 100);

}

GetPlayerName(playerid, sendername, sizeof(sendername));

                        format(string, sizeof(string), "* %s comanda o doza de suc* ", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

else

{

    SendClientMessage(playerid, COLOR_WHITE, "Barman: Nu am auzit de aceasta bautura.");

    return 1;

}

GetPlayerHealth(playerid, health);

if (health > 100) SetPlayerHealth(playerid, 100);

            }

            else

            {

                SendClientMessage(playerid, COLOR_GREY, "  You can't drink anymore, you will throw up!");

                return 1;

            }

        }

        else

        {

            SendClientMessage(playerid, COLOR_GREY, "  You are not at a Bar!");

            return 1;

        }

    }

    return 1;

}

[/pawn]

aici    if(PlayerToPoint(10.0,playerid,COORDONATELE X Y Z ))  in loc de COORDONATELE X Y Z pui coordonate unde vrei tu sa foloseasca playerul /drink ! Ca sa le afli dai /save (din game unde vrei sa dea playerul /drink) si dupa le gasesti in my documents  GTA San Andreas User Files -  SAMP si le ai acolo

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.