SA-MP Forums Archive
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=352883)



Warning 225 : Unreachable code - Uberanwar - 21.06.2012

Hi guys I have a problem with this..


C:\Users\sofie's\Desktop\CCNRRPG\gamemodes\CCNRRPG .pwn(11456) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Quote:

if(newkeys & KEY_SECONDARY_ATTACK && PlayerToPoint(1.0, playerid, 247.7420,71.6222,1003.6406)) //FBI Shutter Outside
{
if(GetPlayerSkin(playerid) != 286)
{
SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
return 1;
}

I need help with this. Please Help me!


Re: Warning 225 : Unreachable code - Jonny5 - 21.06.2012

indent your code to see your error it is very clear that your missings a closing bracket,
at least from the code you posted you are.

pawn Код:
if((newkeys & KEY_SECONDARY_ATTACK) && PlayerToPoint(1.0, playerid, 247.7420,71.6222,1003.6406)) //FBI Shutter Outside
{
    if(GetPlayerSkin(playerid) != 286)
    {
        SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
        return 1;
    }
}
also notice i wrapped (newkeys & KEY_SECONDARY_ATTACK)
this way you check this, and if its true you check PlayerToPoint,


Re: Warning 255 : Unreachable code - newbienoob - 21.06.2012

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK && PlayerToPoint(1.0, playerid, 247.7420,71.6222,1003.6406)) //FBI Shutter Outside
{ // Open 1
if(GetPlayerSkin(playerid) != 286)
{ // Open 2
SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
return 1;
} // Close 1
//??? Where's Close 2?



Re: Warning 225 : Unreachable code - Uberanwar - 21.06.2012

Okay wait


Re: Warning 225 : Unreachable code - Macluawn - 21.06.2012

brackets cause different errors.
EDIT: The problem doesnt appear to be in this part of the code. Which one is line 11456?