/drink Befehl geht nicht zieht allerdings Geld ab

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • hallo freunde,


    mein /drink befehl Funktioniert nicht es wird mir zwar geld abgezogen allerdings steht dann da Server Unknown Command..


    hier mal der Code


    if(strcmp(cmd, "/drink", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(IsPlayerInRangeOfPoint(playerid,3.0,499.4521,-20.6484,1000.6797))
    {
    new local = PlayerInfo[playerid][pLocal];
    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 __________________|");
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /drink [Drink]");
    SendClientMessage(playerid, COLOR_GREY, "Verfügbare Drinks: Bier ($60), Vodka ($100), V+Energy ($100), Wasser ($20), Soda($10)");
    SendClientMessage(playerid, COLOR_GREY, "Verfügbare Drinks: Mixery (20$), Grapefruit (20$), Cola (10$), Fanta (10$)");
    SendClientMessage(playerid, COLOR_WHITE, "|________________________________________________|");
    return 1;
    }
    if(strcmp(x_nr,"Bier",true) == 0)
    {
    GivePlayerMoney(playerid, - 60);
    BizzInfo[local-99][bProducts] -= 1;
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    PlayerDrunk[playerid] += 1;
    if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Du bist~n~~p~betrunken", 3500, 1);
    BizzInfo[local-99][bTill] += 60; }
    SetPlayerTime(playerid,22,10);
    SetPlayerDrunkLevel(playerid,50000);
    SetPlayerWeather(playerid,-66);
    PlayerStoned[playerid] += 1;
    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,"Mixery", true) == 0)
    {
    GivePlayerMoney(playerid, -10);
    BizzInfo[local-99][bProducts] -= 1;
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    PlayerDrunk[playerid] += 2;
    if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Du bist~n~~p~betrunken", 3500, 1);
    BizzInfo[local-99][bTill] += 10; }
    SetPlayerTime(playerid,22,10);
    SetPlayerDrunkLevel(playerid,50000);
    SetPlayerWeather(playerid,-66);
    PlayerStoned[playerid] += 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,"Grapefruit", true) == 0)
    {
    GivePlayerMoney(playerid, -20);
    BizzInfo[local-99][bProducts] -= 1;
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    PlayerDrunk[playerid] += 2;
    if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Du bist~n~~p~betrunken", 3500, 1);
    BizzInfo[local-99][bTill] += 20; }
    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,"Cola", true) == 0)
    {
    GivePlayerMoney(playerid, -10);
    BizzInfo[local-99][bProducts] -= 1;
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    PlayerDrunk[playerid] += 2;
    BizzInfo[local-99][bTill] += 10;
    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,"Fanta", true) == 0)
    {
    GivePlayerMoney(playerid, -20);
    BizzInfo[local-99][bProducts] -= 1;
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    PlayerDrunk[playerid] += 2;
    BizzInfo[local-99][bTill] += 20;
    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,"Vodka",true) == 0)
    {
    GivePlayerMoney(playerid, - 10);
    BizzInfo[local-99][bProducts] -= 1;
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    PlayerDrunk[playerid] += 2;
    if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Du bist~n~~p~betrunken", 3500, 1);
    BizzInfo[local-99][bTill] += 100; }
    SetPlayerTime(playerid,22,10);
    SetPlayerDrunkLevel(playerid,50000);
    SetPlayerWeather(playerid,-66);
    PlayerStoned[playerid] += 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,"V+Energy",true) == 0)
    {
    GivePlayerMoney(playerid, - 100);
    BizzInfo[local-99][bProducts] -= 1;
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    PlayerDrunk[playerid] += 3;
    if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~Du bist~n~~p~betrunken", 3500, 1);
    BizzInfo[local-99][bTill] += 100; }
    SetPlayerTime(playerid,22,10);
    SetPlayerDrunkLevel(playerid,50000);
    SetPlayerWeather(playerid,-66);
    PlayerStoned[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); }
    else { SetPlayerHealth(playerid, health + 27.0); }
    }
    }
    else if(strcmp(x_nr,"Wasser",true) == 0)
    {
    GivePlayerMoney(playerid, - 20);
    BizzInfo[local-99][bTill] += 20;
    BizzInfo[local-99][bProducts] -= 1;
    if(GetPlayerHealth(playerid, health) < 100)
    {
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
    else { SetPlayerHealth(playerid, health + 5.0); }
    }
    }
    else if(strcmp(x_nr,"Soda",true) == 0)
    {
    GivePlayerMoney(playerid, - 10);
    BizzInfo[local-99][bTill] += 10;
    BizzInfo[local-99][bProducts] -= 1;
    if(GetPlayerHealth(playerid, health) < 100)
    {
    if(PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp = 2 * PlayerInfo[playerid][pAlcoholPerk]; hp += 5; SetPlayerHealth(playerid, health + hp); }
    else { SetPlayerHealth(playerid, health + 5.0); }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "Barkeeper: Sorry, ich kenne dieses Getränk nicht.");
    return 1;
    }
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s trinkt %s.", sendername ,x_nr);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du kannst nicht mehr trinken, sonst musst du brechen !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Es ist kein Barkeeper in der nähe ? !");
    return 1;
    }
    }
    return 1;
    }