PDA

View Full Version : Warning 225 : Unreachable code


Uberanwar
21/06/2012, 02:03 PM
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 (c) 1997-2006, ITB CompuPhase


1 Warning.

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! :(

Jonny5
21/06/2012, 02:07 PM
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.


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,

newbienoob
21/06/2012, 02:08 PM
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?

Uberanwar
21/06/2012, 02:11 PM
Okay wait

Macluawn
21/06/2012, 02:11 PM
brackets cause different errors.
EDIT: The problem doesnt appear to be in this part of the code. Which one is line 11456?