[Warning] 225 Unreachable Code
#1

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 © 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
Reply
#2

pawn Код:
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
Reply
#3

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 ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)