Something Wrong[Rep]
#1

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(cmdtextidx);
                                if(!
strlen(x_nr)) {
                                    
SendClientMessage(playeridCOLOR_LIGHTRED"(Bauturi la Bar)");
                                    
SendClientMessage(playeridCOLOR_LIGHTBLUE"USAGE: /drink [drinkname]");
                                      
SendClientMessage(playeridCOLOR_RED"Apa ($10),Fanta ($4),Bere ($10),Tuica($8),Sampanie($100)");
                                      
SendClientMessage(playeridCOLOR_RED"Vodka ($20),Lichior($18)");
                                      
SendClientMessage(playeridCOLOR_VIOLET"Aveti grija sa nu va stricati Ficatul!");
                                    return 
1;
                                }
                                if(
strcmp(x_nr,"bere",true) == 0)
                                {
                                    if(
PlayerInfo[playerid][pAge] < 16)
                                    {
                                        
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 16 ani!");
                                        return 
1;
                                    }
                                    
SafeGivePlayerMoney(playerid, - 10);
                                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_BEER);
                                    
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); }
                                    }
                                }
                                else if(
strcmp(x_nr,"tuica",true) == 0)
                                {
                                    if(
PlayerInfo[playerid][pAge] < 18)
                                    {
                                        
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                                        return 
1;
                                    }
                                    
SafeGivePlayerMoney(playerid, - 8);
                                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_BEER);
                                    
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); }
                                    }
                                }
                                else if(
strcmp(x_nr,"sampanie",true) == 0)
                                {
                                    if(
PlayerInfo[playerid][pAge] < 18)
                                    {
                                        
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                                        return 
1;
                                    }
                                    
SafeGivePlayerMoney(playerid, - 100);
                                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_WINE);
                                    
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); }
                                    }
                                }
                                else if(
strcmp(x_nr,"vodka",true) == 0)
                                {
                                    if(
PlayerInfo[playerid][pAge] < 18)
                                    {
                                        
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                                        return 
1;
                                    }
                                    
SafeGivePlayerMoney(playerid, - 20);
                                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_WINE);
                                    
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); }
                                    }
                                }
                                else if(
strcmp(x_nr,"lichior",true) == 0)
                                {
                                    if(
PlayerInfo[playerid][pAge] < 18)
                                    {
                                        
SendClientMessage(playeridCOLOR_WHITE"Barman:Scuzati trebuie sa detineti varsta de 18 ani!");
                                        return 
1;
                                    }
                                    
SafeGivePlayerMoney(playerid, - 18);
                                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_WINE);
                                    
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); }
                                    }
                                }
                                else if(
strcmp(x_nr,"apa",true) == 0)
                                {
                                    
SafeGivePlayerMoney(playerid, - 10);
                                    
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);
                                    }
                                }
                                else if(
strcmp(x_nr,"fanta",true) == 0)
                                {
                                    
SafeGivePlayerMoney(playerid, - 4);
                                    
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);
                                    }
                                }
                                else
                                {
                                    
SendClientMessage(playeridCOLOR_WHITE"Bartender: I don't know that Drink Name.");
                                    return 
1;
                                }
                                
GetPlayerHealth(playeridhealth);
                                if (
health 100SetPlayerHealth(playerid100);
                                
format(stringsizeof(string), "* %s bea %s de la pahar."sendername ,x_nr);
                                
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   Numai poti sa bei");
                                return 
1;
                            }
                        } 
Reply
#2

Dude where did you put it? Need to be Under public OnPlayerCommandText, and not in middle of other command.
Reply
#3

Are you sure this what you posted is under "OnPlayerCommandText"?
Reply
#4

yes i did it give me 26 errors they have nothing to do with command...if i takeout cmd no errors..if i put it i get errors that have nothing in common with this..
Reply
#5

This means you have a missing bracket somewhere.
Reply
#6

There were some missing brackets somewhere.

I've seen you post before, and lemme tell you. You should stop using Raven's Roleplay. Dude! You're a beginner! Raven's Roleplay is hardly editable, and not for beginners. Take my advice and start on another gamemode.
pawn Код:
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;
            }
        }
    }
}
Try this
Reply
#7

i got no ravens..i friend gave it to me..now i now that he didnt do it..trying it now
Reply
#8

error 001: expected token: ";", but found "if"
error 001: expected token: ";", but found "if"


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(cmdtextidx);
    if(!
strlen(x_nr)) {
    
SendClientMessage(playeridCOLOR_LIGHTRED"(Bauturi la Bar)");
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"USAGE: /drink [drinkname]");
    
SendClientMessage(playeridCOLOR_RED"Apa ($10),Fanta ($4),Bere ($10),Tuica($8),Sampanie($100)");
    
SendClientMessage(playeridCOLOR_RED"Vodka ($20),Lichior($18)");
    
SendClientMessage(playeridCOLOR_LIGHTRED"Aveti grija sa nu va stricati Ficatul!");
    return 
1;
    }
    if(
strcmp(x_nr,"bere",true) == 0)
    {
    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);
    
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); }
    }
    }
    else if(
strcmp(x_nr,"tuica",true) == 0)
    {
    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);
    
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); }
    }
    }
    else if(
strcmp(x_nr,"sampanie",true) == 0)
    {
    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);
    
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); }
    }
    }
    else if(
strcmp(x_nr,"vodka",true) == 0)
    {
    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);
    
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); }
    }
    }
    else if(
strcmp(x_nr,"lichior",true) == 0)
    {
    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);
    
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); }
    }
    }
    else if(
strcmp(x_nr,"apa",true) == 0)
    {
    
GivePlayerCash(playerid, - 10);
    
GetPlayerHealth(playeridhealth);
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_SPRUNK);
    
SetPlayerDrunkLevel(playerid, -1000)
ERROR    if(health 100// HEREEEE
    
{
    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);
    }
    }
    else if(
strcmp(x_nr,"fanta",true) == 0)
    {
    
GivePlayerCash(playerid, - 4);
    
GetPlayerHealth(playeridhealth);
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_SPRUNK);
    
SetPlayerDrunkLevel(playerid, -1000)
ERROR !    if(health 100// HERE
    
{
    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);
    }
    }
    else
    {
    
SendClientMessage(playeridCOLOR_WHITE"Bartender: I don't know that Drink Name.");
    return 
1;
    }
    
GetPlayerHealth(playeridhealth);
    if (
health 100SetPlayerHealth(playerid100);
    
format(stringsizeof(string), "* %s bea %s de la pahar."sendername ,x_nr);
    
ProxDetector(30.0playeridstringCOLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
    }
    else
    {
    
SendClientMessage(playeridCOLOR_GREY"   Numai poti sa bei");
    return 
1;
    }
    }
    }
    } 
Reply
#9

anyone please
Reply
#10

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
anyone please
Post the error lines!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)