12.06.2012, 16:45
i made a drink dialog but i dot get it why i get 26 errors..isnt the cmd good?
PHP код:
if ( dialogid == Dialog_Bar )
{
if ( response )
{
if( listitem == 0 )
{
if(PlayerInfo[playerid][pAge] < 16)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 16 ani!");
return 1;
}
GivePlayerCash(playerid, - 10);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
new Float:health;
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); }
}
}
if( listitem == 1 )
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
GivePlayerCash(playerid, - 8);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
new Float:health;
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); }
}
}
if( listitem == 2 )
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
GivePlayerCash(playerid, - 100);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
new Float:health;
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); }
}
}
if( listitem == 3 )
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
GivePlayerCash(playerid, - 20);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
new Float:health;
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); }
}
}
if( listitem == 4 )
{
if(PlayerInfo[playerid][pAge] < 18)
{
SendClientMessage(playerid, COLOR_WHITE, "Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
return 1;
}
GivePlayerCash(playerid, - 18);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
new Float:health;
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); }
}
}
if(listitem== 5 )
{
GivePlayerCash(playerid, - 10);
new Float:health;
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);
}
}
if(listitem == 6 )
{
GivePlayerCash(playerid, - 4);
new Float:health;
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);
}
}
return 1;
}
PHP код:
if(strcmp(cmd, "/drink", true) == 0)
{
if(IsAtBar(playerid))
{
if(GetPlayerDrunkLevel(playerid) <= 20000)
{
ShowPlayerDialog(playerid,Dialog_Bar,DIALOG_STYLE_LIST,"{278227}Bar","Apa\nFanta\nBere\nTuica\nSampanie\nVodka\nLichior","Selecteaza","Inchide");
return 1;
{
SendClientMessage(playerid, COLOR_WHITE, "Bartender: I don't know that Drink Name.");
return 1;
}
format(string, sizeof(string), "* %s bea %s de la pahar.", sendername,Dialog_Bar);
ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Numai poti sa bei");
return 1;
}
}
}
}