[Error]Loose indentation
#1

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;
        }
    }
Reply
#2

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.
Reply
#3

How can I remove the warning then?
Reply
#4

Add this at the top of your script:

pawn Код:
#pragma tabsize 0
Reply
#5

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;
        }
    }
Reply
#6

or just ident your code properly...
Reply
#7

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
Reply
#8

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
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)