Warning 255: Unreachable Code
#1

I need help with my Warning 255: Unreachable Code

Warnings:
Код:
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43566) : warning 225: unreachable code
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(43584) : warning 225: unreachable code
CODE:
Код:
Line 43566:     {
	    		new length = strlen(cmdtext);
				while ((idx < length) && (cmdtext[idx] <= ' '))
		{
				idx++;
		}
				new offset = idx;
				new result[20];
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
		{
				result[idx - offset] = cmdtext[idx];
				idx++;
		}
				result[idx - offset] = EOS;

        return 1;
	}
And Second Warning line 43584 Starts on: if(strcmp(cmd, "/accent", true) == 0)...
Код:
if(strcmp(cmd, "/accent", true) == 0)
	{
	    new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		new result[16];
		while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
		{
			result[idx - offset] = cmdtext[idx];
			idx++;
		}
		result[idx - offset] = EOS;
   		if(!strlen(result))
		{
			SendClientMessage(playerid, COLOR_GREY, "USAGE: /accent [accent type] (set your accent as 'none' for no accent)");
			return 1;
		}
		strmid(Accent[playerid], result, 0, strlen(result), 255);
		format(string, sizeof(string), "You have changed your accent to '%s'.", Accent[playerid]);
		SendClientMessage(playerid,COLOR_WHITE,string);
		return 1;
	}
Reply
#2

those are the lines that are unreachable the problem is befor it there is a return or an else preventing script from getting to the lines you have shown
Reply
#3

You must have messed used brackets or return at some point
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)