SA-MP Forums Archive
How to fix this warning - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to fix this warning (/showthread.php?tid=224549)



How to fix this warning - [nL]W0rfleR - 12.02.2011

I get this warning in the gm i dunno how to fix it its

C:\Users\Desktop\Server1\gamemodes\testgm.pwn(5394 ) : warning 217: loose indentation

warning is a ( new file[256]; )


Re: How to fix this warning - Backwardsman97 - 12.02.2011

Just indent properly. It keeps your code organized and easy to read, especially if you have a logic error. Or, if you don't feel like doing that, you can just add this to the top of your script.

pawn Код:
#pragma tabsize 0
Or you could just properly indent. :P


Re: How to fix this warning - Zack9764 - 12.02.2011

Codes always help. I also highly agree with Backwardsman. It keeps your script organized.


Re: How to fix this warning - Mean - 12.02.2011

Actually, #pragma tabsize 0 can cause some problems, just indent the code. Examples:

Wrong indentation:
pawn Код:
CMD:abcd( playerid, params[ ] )
{
      ab = GetPlayerColor( playerid );
   SendClientMessage( playerid, ab, "This is your color" );
      SendClientMessage( playerid, ab, "Abcdefgh" );
return 1;
}
Good indentation:
pawn Код:
CMD:abcd( playerid, params[ ] )
{
    ab = GetPlayerColor( playerid );
    SendClientMessage( playerid, ab, "This is your color" );
    SendClientMessage( playerid, ab, "Abcdefgh" );
    return 1;
}
So practically, your spacing must be 4 spaces! Not something else!