why doesn't compile this code
#1

why i get errors when compile this code?

Код:
public OnGameModeInit()
{
  print("my gamemode");
  ConnectNPC("MyFirstNPC","mynpc");
  return 1;
}
this is my error
Код:
C:\PROGRA~1\ROCKST~1\SERVER~1.3AR\GAMEMO~1\Sfinx_17.pwn(159) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#2

Whats line 157,158 and 159?
Reply
#3

you mean what line is putted the code in my script?
Reply
#4

In which line are the error?
Ex:

Which of these lines are the error on?

pawn Код:
public OnGameModeInit() //On this?
{ //Or this?
  print("my gamemode"); //Or this?
  ConnectNPC("MyFirstNPC","mynpc"); //Or this?
  return 1; //Or this?
} //Or this?
Reply
#5

lol i allready post the error code but how to know wich is the line what have error i don't understand
explain better plz

how to find what line is the error? lol
Reply
#6

The numbers marked with black are the line numbers:

[img width=1024 height=575]http://i37.tinypic.com/2zizxbn.jpg[/img]
Reply
#7

that's more better

this is the lines 154, 155, 156, 157
Reply
#8

Quote:
Originally Posted by Sfinx_17
why i get errors when compile this code?

Код:
public OnGameModeInit()
{
  print("my gamemode");
  ConnectNPC("MyFirstNPC","mynpc");
  return 1;
}
this is my error
Код:
C:\PROGRA~1\ROCKST~1\SERVER~1.3AR\GAMEMO~1\Sfinx_17.pwn(159) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Then you don't even show line 159 in your picture, then we can't see what the error is.
Reply
#9

Код:
C:\PROGRA~1\ROCKST~1\SERVER~1.3AR\GAMEMO~1\Sfinx_17.pwn(159) : warning 225: unreachable code
means that the code directly below ongamemodeinit isnt accessible by the compiler. im not sure as to why this is since i cant see your whole script and only 4 lines, but i would try changing the return 1; to a return 0; or something
Reply
#10

Quote:
Originally Posted by iLinx
but i would try changing the return 1; to a return 0; or something
There is no sense in that.

Quote:
Originally Posted by pawn-lang.pdf
error 225 - unreachable code:
The indicated code will never run, because an instruction before (above) it causes a jump out of the function, out of a loop or elsewhere. Look for return, break, continue and goto instructions above the indicated line. Unreachable code can also be caused by an endless loop above the indicated line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)