Heey ich habe ein problem ich habe den /drink befehl drin und wenn ich ihn benutze kommt da Server Unknow Command aber er zieht mir trotzdem Geld ab und dadurch ka**t mein compiler ab hier die zeilen
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);
}
}
}
}
}
return 1; //Hier hat ein Return gefehlt
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