15.05.2014, 19:35
pawn Код:
if(GetPlayerWantedLevel(ID) >=3)
Warning:
Код:
warning 225: unreachable code
if(GetPlayerWantedLevel(ID) >=3)
warning 225: unreachable code
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. |
Most of the times, this warning is given if you return something and at the next line there is code.
|
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;
}