вот моя команда что бы пить if(strcmp(cmd, "/drink", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtBar(playerid))
{
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, "Available names: Beer ($6), Vodka ($10), Whiskey ($10), Water ($2), Soda($2)");
SendClientMessage(playerid, COLOR_WHITE, "|________________________________________________|");
return 1;
}
if(strcmp(x_nr,"beer",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Бармен:Извените,но вы не совершеннолетний для спиртного.");
return 1;
}
GivePlayerMoney(playerid, - 6);
PlayerDrunk[playerid] += 1;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 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,"vodka",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
return 1;
}
GivePlayerMoney(playerid, - 10);
PlayerDrunk[playerid] += 2;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 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,"whiskey",true) == 0)
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Bartender: Sorry, you need to be 18 years to get this drink.");
return 1;
}
GivePlayerMoney(playerid, - 10);
PlayerDrunk[playerid] += 3;
if(PlayerDrunk[playerid] >= 5) { GameTextForPlayer(playerid, "~w~You are~n~~p~Drunk", 3500, 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,"water",true) == 0)
{
GivePlayerMoney(playerid, - 2);
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, - 2);
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, "Bartender: I don't know that Drink Name.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s drinks a %s.", sendername ,x_nr);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
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;
}
кто скажет куда тут координаты вставить что бы пить из определённого места