Why is this happening ?
#1

pawn Код:
if(GetPlayerWantedLevel(ID) >=3)

Warning:
Код:
warning 225: unreachable code
Why is this happening ?
Reply
#2

Most of the times, this warning is given if you return something and at the next line there is code.

Quote:
Originally Posted by Pawn Language Guide
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
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Most of the times, this warning is given if you return something and at the next line there is code.
This is another part of the code(the lines after the warning)
pawn Код:
if(GetPlayerWantedLevel(ID) >=3) //Warning line
    {
        format(string,sizeof(string),"[POLICE ACTION] Law Enforcement Officer %s(%d) has arrested %s(%d)",pName,playerid,aName,ID);
        SendClientMessageToAll(COLOR_ORANGE,string);
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"You received 15,000$ and 2 score points for the arrest");
        GivePlayerMoney(playerid,15000);
        new rnd = random(sizeof(JailSpawnPoints));
        JailTime[ID] =180;
        SetPlayerInterior(ID,10);
        SetPlayerPos(ID,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]);
        SetPlayerFacingAngle(ID,JailSpawnPoints[rnd][3]);
        TogglePlayerControllable(ID,1);
        return 1;
    }
EDIT: I FIXEED IT. Thanks for your help once again Kwsta . Ελληνας ειμαι για να ξερεις .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)