Loose Indentation
#1

Код:
   
                    }
				  }
				}
			  }
			}
			if(PlayerInfo[i][pCarTime] > 0)
			{
			  if(PlayerInfo[i][pCarTime] <= 0)
			  {
			    PlayerInfo[i][pCarTime] = 0;
			  }
			  else
			  {
			    PlayerInfo[i][pCarTime] -= 1;
I have a loose indentation will someone please fix it, it is : "if(PlayerInfo[i][pCarTime] > 0)"
Reply
#2

Post the rest of the code, it's hard to find out where the indentation is when you can only see half the code
Reply
#3

ApplyAnimation(i,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
SetPlayerDrunkLevel(i, 10000);
PlayerDrunkTimeLeft[i] += 1;
if(PlayerDrunkTimeLeft[i] == 4)
{
PlayerDrunkTimeLeft[i] = 0;
PlayerDrunk[i] -= 1;
if(PlayerDrunk[i] < 5)
{
GameTextForPlayer(i, "~w~Drunk Effect Has~n~~p~Wore Off", 3500, 1);
SetPlayerDrunkLevel(i, 0);
}
}
}
}
}
if(PlayerInfo[i][pCarTime] > 0)
{
if(PlayerInfo[i][pCarTime] <= 0)
{
PlayerInfo[i][pCarTime] = 0;
}
else
{
PlayerInfo[i][pCarTime] -= 1;
}
}
Reply
#4

pawn Код:
}
                  }
                }
              }
            }
            if(PlayerInfo[i][pCarTime] > 0)
            {
              if(PlayerInfo[i][pCarTime] <= 0)
              {
                PlayerInfo[i][pCarTime] = 0;
              }
              else
              {
                PlayerInfo[i][pCarTime] -= 1;
                ApplyAnimation(i,"PED", "WALK_DRUNK",4.0,0,1,0,0,0);
                SetPlayerDrunkLevel(i, 10000);
                PlayerDrunkTimeLeft += 1;
                if(PlayerDrunkTimeLeft == 4)
                {
                  PlayerDrunkTimeLeft = 0;
                  PlayerDrunk -= 1;
                  if(PlayerDrunk < 5)
                  {
                     GameTextForPlayer(i, "~w~Drunk Effect Has~n~~p~Wore Off", 3500, 1);
                     SetPlayerDrunkLevel(i, 0);
                  }
               }
             }
           }
         }
         if(PlayerInfo[pCarTime] > 0)
         {
           if(PlayerInfo[pCarTime] <= 0)
           {
             PlayerInfo[pCarTime] = 0;
           }
           else
           {
             PlayerInfo[pCarTime] -= 1;
           }
          }
try again...
Reply
#5

You don't have to worry Loose Indentations.
Its just means that you have a code that is
not aligned with others.

Example :
pawn Код:
public OnPlayerConnect(playerid)
{
 GivePlayerMoney(playerid, 2000);
  GivePlayerMoney(playerid, 2001);
 GivePlayerMoney(playerid, 2002);
 return 1;
}
See how the 2nd GivePlayerMoney is not aligned with the others?
Thats Loose Indentation. Don't worry though, it will not affect on
how the way you script functions

But, if your lazy enough just use this :
pawn Код:
#pragma tabsize 0
But I don't recommend you to add that!
I recommend you to fix the alignment of you code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)