Warning 225: Unreachable Code - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Warning 225: Unreachable Code (
/showthread.php?tid=422357)
Warning 225: Unreachable Code -
Vinninho - 13.03.2013
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
}
Re: Warning 225: Unreachable Code -
JaKe Elite - 13.03.2013
remove the return 1; from the line 13602.
Re: Warning 225: Unreachable Code -
LarzI - 13.03.2013
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;
Re: Warning 225: Unreachable Code -
Vinninho - 13.03.2013
Thanks buddy!