Noob Problem [HELP!]
#1

Код:
\GAMEMODE.pwn(679) : error 040: duplicate "case" label (value 0)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I got this error while trying to compile the script. Pls solve this!

Код:
public OnCheckpointEnter(playerid, checkpointid)
{
	switch(checkpointid)

	{
		case Checkpoint 1:

		{
			
		}
		
		case ElCorona:  <<< This is the line of problem

		{
			
		}

	}
	return 1;
}
Reply
#2

Both of them are 0.

I'll give you an example to show you what I mean:
PHP код:
#define AB 0
#define BC 0

// somewhere:
new 5;
switch (
a)
{
    case 
AB: {}
    case 
BC: {}

error 040: duplicate "case" label (value 0) will be given because both AB and BC are defined as 0.
Reply
#3

I dont Understand..what i supposed to do to fix error 040?

Код:
#define AB 0
#define BC 0

// somewhere:
new a = 5;
switch (a)
{
    case AB: {}
    case BC: {}
}
Reply
#4

Case AB is equal to 0
Case BC is equal to 0
Without definitions, it says

new a = 5;
switch (a)
{
case 0: {}
case 0: {}
}
Reply
#5

Thanks! fixed my problem!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)