dupicate case lvl when i add somethiing
#1

ok i have this case BANK_ROB:

then when i add
pawn Код:
case ATM1 || ATM2 || ATM3 || ATM4 || ATM5 || ATM6 || ATM7 || ATM9 || ATM10 || ATM11:
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
            SendClientMessage(playerid, BLUE, "|___ San Andreas's Intl.___|");
            SendClientMessage(playerid, WHITE, "/bankstate To See Your Current $$$ In Your Bank~");
            SendClientMessage(playerid, WHITE, "/Robatm To Rob This Wonderful Atm Machine!");
            }
        }
i get C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAR~1.pwn(4749) : error 040: duplicate "case" label (value 1)

on CASE BANK_ROB:
Reply
#2

If I get what you want, you can`t use case in case, for example:

pawn Код:
case 38:
{
        case MAX_PLAYERS:
        {
                   print ( "WRONG" );
        }
}
Reply
#3

Maybe try this? :
pawn Код:
case ATM1, ATM2, ..... :
Reply
#4

pawn Код:
public OnCheckpointEnter(playerid, checkpointid)
{
    switch(checkpointid)
    {
        case ATM1 || ATM2 || ATM3 || ATM4 || ATM5 || ATM6 || ATM7 || ATM9 || ATM10 || ATM11:
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
            SendClientMessage(playerid, BLUE, "|___ San Andreas's Intl.___|");
            SendClientMessage(playerid, WHITE, "/bankstate To See Your Current $$$ In Your Bank~");
            SendClientMessage(playerid, WHITE, "/Robatm To Rob This Wonderful Atm Machine!");
            }
        }
        case BINCO_ENTER:
        {
            SetPlayerPos(playerid, 207.6548,-107.8569,1005.1328);
            SetPlayerInterior(playerid,15);
        }
        case BINCO_EXIT:
        {
            SetPlayerPos(playerid, 2245.6858,-1661.9924,15.4690);
            SetPlayerInterior(playerid,0);
        }
        case CALG_ENTER:
        {
            SetPlayerPos(playerid, 2236.1987,1680.3585,1008.3594);
            SetPlayerInterior(playerid,1);
        }
        case CALG_EXIT:
        {
            SetPlayerPos(playerid, 2179.0967,1683.8635,11.0469);
            SetPlayerInterior(playerid,0);
        }
        case BANK_ENTER:
        {
            SetPlayerPos(playerid, 2309.3174,-15.7488,26.7496);
            SetPlayerInterior(playerid,0);
        }
        case BANK_EXIT:
        {
            SetPlayerPos(playerid, 1481.1398,-1766.4456,18.7958);
            SetPlayerInterior(playerid,0);
        }
        case BANK_ROB:
        {
            canrobbank[playerid] = true;
            SendClientMessage(playerid, WHITE, "|-| Bank Commands |-|");
            SendClientMessage(playerid, WHITE, "Type /bank To Access Your Bank Account");
            if(gTeam[playerid] == TEAM_CIVILIAN)
            {
                SendClientMessage(playerid, WHITE, "Type /robbank To Rob This Bank.");
            }
            if(gTeam[playerid] == TEAM_COPS)
            {
                SendClientMessage(playerid, RED, " You Are An Police Officer, If You Think You Can Rob Stores/People/Houses/Bussiness Well Think Again.");
            }
              }
          }
}
Reply
#5

thx virus fixed it. i guess u cant do || with checkpoint manager

[edit] sorry double post
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)