PDA

View Full Version : [Warning] 225 Unreachable Code


Mujib
30/11/2009, 05:30 PM
Hi there,

I tried to remove the tutorial from the larp script, i alsmost succeded.
But there is one warning
C:\Users\*****\Desktop\GTA SA MP server\gamemodes\larp.pwn(4023) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

Header size: 9044 bytes
Code size: 1682080 bytes
Data size: 10350084 bytes
Stack/heap size: 16384 bytes; estimated max. usage=5828 cells (23312 bytes)
Total requirements:12057592 bytes

1 Warning.

The lines :

if(AdminSpec[playerid] == 1)
{
return 1;
}


But i think it isnt only these lines, i thing its the whole public function.
So i decdided to paste the function on to pastebin.
http://pawn.pastebin.com/m75c20d88

I would really appriciate all your help.
Thanks in advance!

Regards, Mujib

dice7
30/11/2009, 05:33 PM
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
{
gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
SetPlayerInterior(playerid, 3);
PlayerInfo[playerid][pInt] = 3;
SetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
SetPlayerFacingAngle(playerid, 280);
TogglePlayerControllable(playerid, 0);
RegistrationStep[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Los Angeles Roleplay server. You will now be taken to Immigration.");
SendClientMessage(playerid, COLOR_LIGHTRED, "First question: Are you a Male or Female? (Type in what you are).");
return 1;
}

You are stopping the code at this point. You forgot an IF or something for this block

Also read this topic to get rid of the memory error
http://forum.sa-mp.com/index.php?topic=79810.0

FireScript
07/01/2012, 12:35 AM
This error happens when you put the value to return if the inside out and then making two return times can not read right, or if you do not finish or else return and place already.

ex:
Wrong:

stock ADMIN(playerid)
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
SendClientMessage(playerid, COLOR_WHITE, " Unable Code!!!");
return 1;
}
return 1;
}
Correct:

stock ADMIN(playerid)
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
SendClientMessage(playerid, COLOR_WHITE, " No Unable Code!!!");
return 1;
}
//return 1; = No Unable Code
}

or
Wrong:

stock ADMIN(playerid);
{
if(PlayerInfo[playerid][pAdmin]>= 5)
{
SendClientMessage(playerid, COLOR_WHITE, " Do not Good Coder!!!");
return 1;
SendClientMessage(playerid, COLOR_WHITE, " Unable Code!!!");
return 1;
}
}
Correct:

stock ADMIN(playerid);
{
if(PlayerInfo[playerid][pAdmin]>= 5)
{
SendClientMessage(playerid, COLOR_WHITE, " I Good Coder!!!");
SendClientMessage(playerid, COLOR_WHITE, " Unable Code!!!");
return 1;
}
}

I'm Brasilian ^^ Helped = Reputation ^^