SA-MP Forums Archive
[Error]Loose indentation - 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)
+--- Thread: [Error]Loose indentation (/showthread.php?tid=339185)



[Error]Loose indentation - HighPitchedVoice - 02.05.2012

pawn Код:
C:\Documents and Settings\Lindvall\Skrivbord\Raven's Roleplay 0.3c V4.2\gamemodes\larp.pwn(5717) : warning 217: loose indentation
How can I remove this error?

This is the code
pawn Код:
format(bancheck, sizeof(bancheck),"LARP/Users/%s.ini",plname);
    if(dini_Exists(bancheck))
    {
        if(dini_Int(bancheck,"Banned") == 1)
        {
            ClearChatbox(playerid, 10);

            SendClientMessage(playerid, COLOR_NICERED,"=======================================YOU ARE BANNED=======================================");
            SendClientMessage(playerid, COLOR_LIGHTRED,"This Name is banned from this Server, And never was unbanned.");
            SendClientMessage(playerid, COLOR_LIGHTRED,"If you wish to be unbanned please visit our website at <changeme>");
            SendClientMessage(playerid, COLOR_LIGHTRED,"Ban Evading will result in a Permanent Range Ban.");
            SendClientMessage(playerid, COLOR_NICERED,"============================================================================================");
            format(msg2,sizeof(msg2),"AdmCmd: %s (%d), Has been banned for Possible Ban Evading",plname,playerid);
            SendAdminMessage(COLOR_LIGHTRED,msg2);
            format(msg2,sizeof(msg2),"AdmCmd: IP %s has been added to the ban list by Anticheat Peter Griffin",playersip);
            SendAdminMessage(COLOR_WHITE,msg2);

            format(msg2,sizeof(msg2),"(%d/%d/%d) [%d:%d:%d] %s Has been kicked by the anticheat for Possible Ban Evading",d,m,y,h,mi,s,plname);
            KickLog(msg2);

            SetTimerEx("ScriptBan",500,false,"iis",playerid,999,"Ban Evading");
            return 0;
        }
    }



Re: [Error]Loose indentation - pyrodave - 02.05.2012

First its a warning not an error, so your script will still run, but its still very important to fix warnings!

Simple fix for this one though, put your cursor in front of the very top line of your code (of the code you posted), and push the tab key, then recompile and it should be fine.


Re: [Error]Loose indentation - HighPitchedVoice - 02.05.2012

How can I remove the warning then?


Re: [Error]Loose indentation - sniperwars - 02.05.2012

Add this at the top of your script:

pawn Код:
#pragma tabsize 0



Re: [Error]Loose indentation - ViniBorn - 02.05.2012

pawn Код:
format(bancheck, sizeof(bancheck),"LARP/Users/%s.ini",plname);// Add tab in this line to align with the next line
    if(dini_Exists(bancheck))
    {
        if(dini_Int(bancheck,"Banned") == 1)
        {
            ClearChatbox(playerid, 10);

            SendClientMessage(playerid, COLOR_NICERED,"=======================================YOU ARE BANNED=======================================");
            SendClientMessage(playerid, COLOR_LIGHTRED,"This Name is banned from this Server, And never was unbanned.");
            SendClientMessage(playerid, COLOR_LIGHTRED,"If you wish to be unbanned please visit our website at <changeme>");
            SendClientMessage(playerid, COLOR_LIGHTRED,"Ban Evading will result in a Permanent Range Ban.");
            SendClientMessage(playerid, COLOR_NICERED,"============================================================================================");
            format(msg2,sizeof(msg2),"AdmCmd: %s (%d), Has been banned for Possible Ban Evading",plname,playerid);
            SendAdminMessage(COLOR_LIGHTRED,msg2);
            format(msg2,sizeof(msg2),"AdmCmd: IP %s has been added to the ban list by Anticheat Peter Griffin",playersip);
            SendAdminMessage(COLOR_WHITE,msg2);

            format(msg2,sizeof(msg2),"(%d/%d/%d) [%d:%d:%d] %s Has been kicked by the anticheat for Possible Ban Evading",d,m,y,h,mi,s,plname);
            KickLog(msg2);

            SetTimerEx("ScriptBan",500,false,"iis",playerid,999,"Ban Evading");
            return 0;
        }
    }



Re: [Error]Loose indentation - Reynolds - 02.05.2012

or just ident your code properly...


Re: [Error]Loose indentation - Jstylezzz - 02.05.2012

pawn Код:
format(bancheck, sizeof(bancheck),"LARP/Users/%s.ini",plname);// Add tab in this line to align with the next line
put your cursor in front of "format" and hit the tab key, so it's in one line with the if statement


Re: [Error]Loose indentation - FalconX - 02.05.2012

Quote:
Originally Posted by sniperwars
Посмотреть сообщение
Add this at the top of your script:

pawn Код:
#pragma tabsize 0
This is just so stupid. This is not a solution for errors/warnings but only ignores the warnings/errors. Do you even know that even small warnings/errors can cause the server bug? The script is never clean when there are warnings/errors.

This is just a ignorance to those errors/warnings. And for removing the "Lose Indentation", it is very easy to learn how to fix and get rid of such errors/warnings. Stop giving people this kind of info which is almost useless.

For those who can not get rid of Loose Indentation can use the following tutorial to remove them.

https://sampforum.blast.hk/showthread.php?tid=256961
-FalconX


Re: [Error]Loose indentation - Mark™ - 02.05.2012

Alternatively, you can use this online tool to auto-indent your code.