01.03.2012, 21:02
i put this and pawno stops responding...[Rep]
PHP код:
if(strcmp(cmd, "/drink", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtBar(playerid))
{
if(GetPlayerDrunkLevel(playerid) <= 20000)
{
new Float:health;
new x_nr[24];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_LIGHTRED, "(Bauturi la Bar)");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /drink [drinkname]");
SendClientMessage(playerid, COLOR_RED, "Apa ($10),Fanta ($4),Bere ($10),Tuica($8),Sampanie($100)");
SendClientMessage(playerid, COLOR_RED, "Vodka ($20),Lichior($18)");
SendClientMessage(playerid, COLOR_VIOLET, "Aveti grija sa nu va stricati Ficatul!");
return 1;
}
if(strcmp(x_nr,"bere",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 16)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 16 ani!");
return 1;
}
SafeGivePlayerMoney(playerid, - 10);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
GetPlayerHealth(playerid, health);
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); }
}
}
else if(strcmp(x_nr,"tuica",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
SafeGivePlayerMoney(playerid, - 8);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
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); }
}
}
else if(strcmp(x_nr,"sampanie",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
SafeGivePlayerMoney(playerid, - 100);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
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); }
}
}
else if(strcmp(x_nr,"vodka",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
SafeGivePlayerMoney(playerid, - 20);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
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); }
}
}
else if(strcmp(x_nr,"lichior",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
SafeGivePlayerMoney(playerid, - 18);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
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); }
}
}
else if(strcmp(x_nr,"apa",true) == 0)
{
SafeGivePlayerMoney(playerid, - 10);
GetPlayerHealth(playerid, health);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerDrunkLevel(playerid, -1000)
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);
}
}
else if(strcmp(x_nr,"fanta",true) == 0)
{
SafeGivePlayerMoney(playerid, - 4);
GetPlayerHealth(playerid, health);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SetPlayerDrunkLevel(playerid, -1000)
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);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Bartender: I don't know that Drink Name.");
return 1;
}
GetPlayerHealth(playerid, health);
if (health > 100) SetPlayerHealth(playerid, 100);
format(string, sizeof(string), "* %s bea %s de la pahar.", sendername ,x_nr);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Numai poti sa bei");
return 1;
}
}