Help to FIX a warning 225: unreachable code
#1

my code have a
Код:
warning 225: unreachable code
can you help me to fix this
line of this warning
Код:
if(dialogid == DIALOG_REFUND)
	{
	    if(response)
	    {
	    if(listitem == 0)
	    {
			if(PlayerInfo[playerid][pCoin] >= 0)
			{
				SendClientMessage(playerid , COLOR_WHITE,"Ban da duoc Refund Vip Gold 3days + 10tokens");
	    		PlayerInfo[playerid][pDonateRank] = 3;
    			PlayerInfo[playerid][pTokens] = 10;
	    		PlayerInfo[playerid][pVIPExpire] = gettime()+259200*1;
			}
			else
			{
			SendClientMessage(playerid,COLOR_GREY,"ERROR : ban khong du Coin ");
			}
		}
		if(listitem == 1)
		{
		    if(PlayerInfo[playerid][pCoin] >= 0)
			{
			    SendClientMessage(playerid,  COLOR_WHITE,"Ban da duoc Refund Vip Bac 15days + 12 Tokens");
  			  PlayerInfo[playerid][pDonateRank] = 1;
	    		PlayerInfo[playerid][pTokens] = 12;
		    	PlayerInfo[playerid][pVIPExpire] = gettime()+1296000*1;
			}
			else
			{
			SendClientMessage(playerid,COLOR_GREY,"ERROR : ban khong du Coin ");
			}
		}
 		if(listitem == 2)
		{
		    if(PlayerInfo[playerid][pCoin] >= 0)
			{
			    SendClientMessage(playerid,  COLOR_WHITE,"Ban da duoc Refund 500,000$");
			    GivePlayerCash(playerid, 500000);
			}
			else
			{
			SendClientMessage(playerid,COLOR_GREY,"ERROR : ban khong du Coin ");
			}
		}
 		if(listitem == 3)
		{
		    if(PlayerInfo[playerid][pCoin] >= 0)
			{
   				SendClientMessage(playerid,  COLOR_WHITE,"Ban da duoc Refund Cap 2");
			    PlayerInfo[playerid][pLevel] = 2;
			}
			else
			{
			SendClientMessage(playerid,COLOR_GREY,"ERROR : ban khong du Coin ");
				}
			}
		}
		return 1;
	}
Reply
#2

First of all, warnings do NOT affect your script at all, second thing, you've showed us the whole code, not the line, so please, show us which line exactly has the warning.
Reply
#3

Quote:
Originally Posted by HyDrAtIc
Посмотреть сообщение
First of all, warnings do NOT affect your script at all
Yes, they DO. Especially this one. If they don't affect your script, then why do we need the warnings in the first place? Warnings are thrown for common mistakes and compiler assumptions.

@OP: Check the lines just above the snippet you posted. There is probably a return that shouldn't be there.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)