"warning 217: loose indentation"
#1

Hello everyone, I'm newbie and I'm learning how to script and I have error that I don't understand but all works fine so can you guys help me

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
 {
     if(dialogid == DIALOG_HELP)
     {
       if(response)
       {
	      if(listitem == 0)
	      {
		     SendClientMessage(playerid, COL_YELLOW, "/yolo");
          }
	      if(listitem == 1)
	      {
		     SendClientMessage(playerid, COL_WHITE, "No!");
	      }
	      if(listitem == 2)
	      {
		       if(IsPlayerAdmin (playerid))
		       {
			        SendClientMessage(playerid, COL_YELLOW, "/rconhelp");
		       }
		       else
		       {
			        SendClientMessage(playerid, COL_RED, "You are not an admin");
		       }
	      }
          return 1;
       }
  }
  return 0;
}
Error: C:\Users\Iwan\Desktop\samp\gamemodes\CT.pwn(94) : warning 217: loose indentation

94th line is this one
Код:
  return 0;
Thank you very much, regards!
Reply
#2

What mirou123 told you to do will just HIDE the warnings. DON'T DO THAT.

It is very important to fix indentation.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
 {
    if(dialogid == DIALOG_HELP)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid, COL_YELLOW, "/yolo");
            }
            if(listitem == 1)
            {
                SendClientMessage(playerid, COL_WHITE, "No!");
            }
        if(listitem == 2)
        {
            if(IsPlayerAdmin (playerid))
            {
                SendClientMessage(playerid, COL_YELLOW, "/rconhelp");
            }
            else
            {
                SendClientMessage(playerid, COL_RED, "You are not an admin");
            }
        }
        return 1;
    }
    return 0;
}
Reply
#3

I still don't know what's the problem
Reply
#4

Loose indentation means that several things are misplaced.
Example:

pawn Код:
public OnGameModeInit()
{
    return 1;
   }//This one is too far out.

public OnGameModeInit()
{
    return 1;
}//While this is correct.
Get my point?
An extra space/tab will give you the warning =)
Reply
#5

Thank you very much

(+rep by me, ty)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)