[Duda] Que quiere decir este error ? :O
#1

Quote:

error 040: duplicate "case" label (value 5)

Que quiere decir ?

Solucionado Xd

Lo que quiere decir es que Repetiste un case.

Ejemplo.

pawn Код:
case ClassTrainDriver
        {
            Index = random(sizeof(ASpawnLocationsRoadWorker));
            x = ASpawnLocationsRoadWorker[Index][SpawnX]; // Get the X-position for the spawnlocation
            y = ASpawnLocationsRoadWorker[Index][SpawnY]; // Get the Y-position for the spawnlocation
            z = ASpawnLocationsRoadWorker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
            Angle = ASpawnLocationsRoadWorker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
            format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Roadworker class", Name);
        }
        case ClassTrainDriver:
        {
            Index = random(sizeof(ASpawnLocationsTrainDriver));
            x = ASpawnLocationsTrainDriver[Index][SpawnX]; // Get the X-position for the spawnlocation
            y = ASpawnLocationsTrainDriver[Index][SpawnY]; // Get the Y-position for the spawnlocation
            z = ASpawnLocationsTrainDriver[Index][SpawnZ]; // Get the Z-position for the spawnlocation
            Angle = ASpawnLocationsTrainDriver[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
            format(Msg, 128, "{00FF00}Player {FFFF00}%s{00FF00} joined {FFFF00}Train Driver class", Name);
        }
Reply
#2

significa que tenes el valor 5 en 2 casos diferentes.
Ej:
pawn Код:
new rnd = random(8);
switch(rnd){
    case 0, 1, 2:
        print("caso 0, 1 o 2");
    case 3 .. 6:
        print("caso 3-6");
    case 7, 8://valor repetido (8)
        print("caso 7 u 8");
    case 8://valor repetido
        print("caso 8");
}
Reply
#3

Quote:
Originally Posted by the_chaoz
Посмотреть сообщение
significa que tenes el valor 5 en 2 casos diferentes.
Ej:
pawn Код:
new rnd = random(8);
switch(rnd){
    case 0, 1, 2:
        print("caso 0, 1 o 2");
    case 3 .. 6:
        print("caso 3-6");
    case 7, 8://valor repetido (8)
        print("caso 7 u 8");
    case 8://valor repetido
        print("caso 8");
}
Exacto, justo me di cuenta gracias igual por responder
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)