SA-MP Forums Archive
Drink Dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Drink Dialog (/showthread.php?tid=350460)



Drink Dialog - Dan_Barocu - 12.06.2012

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 == )
                    {
                    if(
PlayerInfo[playerid][pAge] < 16)
                    {
                    
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 16 ani!");
                    return 
1;
                    }
                    
GivePlayerCash(playerid, - 10);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_BEER);
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    if(
health 100)
                    {
                    if(
PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp PlayerInfo[playerid][pAlcoholPerk]; hp += 10SetPlayerHealth(playeridhealth hp); }
                    else { 
SetPlayerHealth(playeridhealth 10.0); }
                    }
                    }
                    if( 
listitem == )
                    {
                    if(
PlayerInfo[playerid][pAge] < 18)
                    {
                    
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                    return 
1;
                    }
                    
GivePlayerCash(playerid, - 8);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_BEER);
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    if(
health 100)
                    {
                    if(
PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp PlayerInfo[playerid][pAlcoholPerk]; hp += 15SetPlayerHealth(playeridhealth hp); }
                    else { 
SetPlayerHealth(playeridhealth 15.0); }
                    }
                    }
                    if( 
listitem == )
                    {
                    if(
PlayerInfo[playerid][pAge] < 18)
                    {
                    
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                    return 
1;
                    }
                    
GivePlayerCash(playerid, - 100);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_WINE);
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    if(
health 100)
                    {
                    if(
PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp PlayerInfo[playerid][pAlcoholPerk]; hp += 20SetPlayerHealth(playeridhealth hp); }
                    else { 
SetPlayerHealth(playeridhealth 20.0); }
                    }
                    }
                    if( 
listitem == )
                    {
                    if(
PlayerInfo[playerid][pAge] < 18)
                    {
                    
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                    return 
1;
                    }
                    
GivePlayerCash(playerid, - 20);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_WINE);
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    if(
health 100)
                    {
                    if(
PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp PlayerInfo[playerid][pAlcoholPerk]; hp += 27SetPlayerHealth(playeridhealth hp); }
                    else { 
SetPlayerHealth(playeridhealth 27.0); }
                    }
                    }
                    if( 
listitem == )
                    {
                    if(
PlayerInfo[playerid][pAge] < 18)
                    {
                    
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                    return 
1;
                    }
                    
GivePlayerCash(playerid, - 18);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_WINE);
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    if(
health 100)
                    {
                    if(
PlayerInfo[playerid][pAlcoholPerk] > 0) { PlayerDrunk[playerid] += 1; new hp PlayerInfo[playerid][pAlcoholPerk]; hp += 40SetPlayerHealth(playeridhealth hp); }
                    else { 
SetPlayerHealth(playeridhealth 40.0); }
                    }
                    }
                    if(
listitem== )
                    {
                    
GivePlayerCash(playerid, - 10);
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_SPRUNK);
                    
SetPlayerDrunkLevel(playerid, -1000);
                    if(
health 100)
                    {
                    if(
PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp PlayerInfo[playerid][pAlcoholPerk]; hp += 5SetPlayerHealth(playeridhealth hp); }
                    else { 
SetPlayerHealth(playeridhealth 50.0); }
                    }
                    else if(
health 100)
                    {
                    
SetPlayerHealth(playerid100);
                    }
                    }
                    if(
listitem == )
                    {
                    
GivePlayerCash(playerid, - 4);
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_SPRUNK);
                    
SetPlayerDrunkLevel(playerid, -1000);
                    if(
health 100)
                    {
                    if(
PlayerInfo[playerid][pAlcoholPerk] > 0) { new hp PlayerInfo[playerid][pAlcoholPerk]; hp += 5SetPlayerHealth(playeridhealth hp); }
                    else { 
SetPlayerHealth(playeridhealth 50.0); }
                    }
                    else if(
health 100)
                    {
                    
SetPlayerHealth(playerid100);
                    }
                    }
                    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(playeridCOLOR_WHITE"Bartender: I don't know that Drink Name.");
                    return 
1;
                    }
                    
format(stringsizeof(string), "* %s bea %s de la pahar."sendername,Dialog_Bar);
                    
ProxDetector(30.0playeridstringCOLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_GREY"   Numai poti sa bei");
                    return 
1;
                    }
                    }
                    }
                    } 



Re: Drink Dialog - Faisal_khan - 12.06.2012

What are the goddamn ERRORS?


Re: Drink Dialog - Dan_Barocu - 12.06.2012

the 26 errors have nothing in common with the command..


Re: Drink Dialog - Dan_Barocu - 12.06.2012

i guess no one knows..


Re: Drink Dialog - WillyP - 12.06.2012

List the errors and the lines that the errors occur on.


Re: Drink Dialog - milanosie - 12.06.2012

Show us the errors,

ARe they like "UNDEFINED BALBLA"?

If so, your missing a bracket.


Re: Drink Dialog - Faisal_khan - 12.06.2012

Then why you mentioned of the 26 errors if you are feeling shy to paste the errors here?


Re: Drink Dialog - Dan_Barocu - 12.06.2012

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Show us the errors,

ARe they like "UNDEFINED BALBLA"?

If so, your missing a bracket.
yes i dont know where im missing braket..


Re: Drink Dialog - milanosie - 12.06.2012

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
yes i dont know where im missing braket..
Well, break down your code step by step,
Just watch carefully.

Cant help you with that problem as its your code, with your bracket:_)


Re: Drink Dialog - WillyP - 12.06.2012

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
yes i dont know where im missing braket..
How about you read about what people are telling you. Post the errors and the exact lines they occur on!