Warning 225: Unreachable Code
#1

Hey guys, I just cant solve this problem.

I used this: https://sampforum.blast.hk/showthread.php?tid=413986

But, somehow it keeps giving me this error :/

Код:
C:\Users\Vinay\Documents\samp03x_svr_R1-2_win32 (1)\gamemodes\prestigerp.pwn(13602) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
And here is the line
Код:
     if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(EnteredInterior[playerid]) return cmd_exit(playerid, "Exit");
        else return cmd_enter(playerid, "enter");
    	return 1;//13602
}
Reply
#2

remove the return 1; from the line 13602.
Reply
#3

The error occurs because you have an if-else-statement where both results of the condition returns a value. This will stop the code, and make the return 1; unreachable, as the code will never get there. Simply fix by either removing the returns in the statements, or remove return 1;
Reply
#4

Thanks buddy!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)