Unreachable code
#1

Can someone help me out when ever I try to compile this script it gives me the following error;

Код:
(11608) : warning 225: unreachable code
Код:
	if(strcmp(cmd, "/call", true) == 0) {
	    SendClientMessage(playerid, COLOR_LIGHTRED, "Command disabled!");
	    return 1;
LINE 11608->		if(UserInfo[playerid][uPhone] == 1) {
	        new string[200];
		    new number;
		    tmp = strtok(cmdtext, idx);
        	if(!strlen(tmp)) {
            	SendClientMessage(playerid, COLOR_GREY, "USAGE: /call [number]");
            	return 1;
        	}
        	number = strval(tmp);
        	new pnumber = UserInfo[playerid][uNumber];
        	if(UsingPhone[playerid] == 0) {
        	    GetPlayerName(playerid, pname, 24);
        	    GiveNameSpace(pname);
        	    if(Masked[playerid] == 1) {
					format(pname, sizeof(pname), "[Mask_%d_%d]", UserInfo[playerid][uID], RandMask[playerid]);
				}
	        	format(string, sizeof(string), "* %s takes out a cellphone.", pname);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            	CallNumber(playerid, number, pnumber);
            	ApplyAnimation(playerid,"PED","phone_in",4.1,0,1,1,1,0);
            	return 1;
			}
			else {
			    SendClientMessage(playerid, COLOR_GREY, "You are already making a call, use /hangup!");
            	return 1;
        	}
		}
		else {
  			SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have a cellphone!");
     		return 1;
		}
	}
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
You have code after a "return", which marks the end of a function.
Stupid me, thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)