Does this Matter (indentation issue)
#1

As you can see case DIALOG_HELP is set slightly to the right but all other indentations are lined up there on out
Reason being if i had to aline it i'd have to go through hundreds of lines


Reply
#2

Just select all these lines and press SHIFT+TAB, it will remove the indentation
Reply
#3

Quote:
Originally Posted by gimini
Посмотреть сообщение
Just select all these lines and press SHIFT+TAB, it will remove the indentation
But this will also make your script un-organized

If you're to lazy to do it yourself, use this http://dracoblue.net/tidy/pawn/
Reply
#4

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
But this will also make your script un-organized
No, just try it and you will see how it works..
Reply
#5

Example of your "solution":
pawn Код:
if(dialogid == TRANSFERBB)
{
if(response)
{
new target[MAX_PLAYER_NAME], cast[MAX_PLAYER_NAME], mystring[128], targetstring[128], targetfile[128], myfile[128];
if(!strlen(inputtext)) return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
if(strlen(inputtext))
{
new TargetID, Amount;
if(!sscanf(inputtext, "ui", TargetID, Amount))
{
GetPlayerName(playerid, cast, sizeof cast); GetPlayerName(TargetID, target, sizeof target);
format(targetfile, sizeof targetfile, Bankfile, target); format(myfile, sizeof myfile, Bankfile, cast);
if(TargetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, SKY_BLUE, " ** Invalid playerid! ") && TransferBB
if(TargetID == playerid) return SendClientMessage(playerid, SKY_BLUE, " ** You can't send money to your own bank account! ") && TransferBB
if(Amount > dini_Int(myfile, "Cash amount")) return SendClientMessage(playerid, SKY_BLUE, " ** You do not have that amount of money on your bank account! ") && TransferBB
if(Amount < dini_Int(myfile, "Cash amount"))
{
dini_IntSet(myfile, "Cash amount", dini_Int(myfile, "Cash amount") - Amount); dini_IntSet(targetfile, "Cash amount", dini_Int(targetfile, "Cash amount") + Amount);
format(mystring, sizeof mystring, " ** You transfered $%i to %s his bank account ", Amount, TargetID);
format(targetstring, sizeof targetstring, " ** %s transfered $%i to your bank account ", cast, Amount);
SendClientMessage(playerid, SKY_BLUE, mystring); SendClientMessage(TargetID, SKY_BLUE, targetstring);
}
} else {
return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
}
} else {
return SendClientMessage(playerid, SKY_BLUE, " ** Please fill in something ")&& TransferBB
}
}
else if(!response)
{
Bankhome
}
}
Example of the same code, but then with tabs:
pawn Код:
if(dialogid == TRANSFERBB)
    {
        if(response)
        {
            new target[MAX_PLAYER_NAME], cast[MAX_PLAYER_NAME], mystring[128], targetstring[128], targetfile[128], myfile[128];
            if(!strlen(inputtext)) return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
            if(strlen(inputtext))
            {
                new TargetID, Amount;
                if(!sscanf(inputtext, "ui", TargetID, Amount))
                {
                    GetPlayerName(playerid, cast, sizeof cast); GetPlayerName(TargetID, target, sizeof target);
                    format(targetfile, sizeof targetfile, Bankfile, target); format(myfile, sizeof myfile, Bankfile, cast);
                    if(TargetID == INVALID_PLAYER_ID) return SendClientMessage(playerid, SKY_BLUE, " ** Invalid playerid! ") && TransferBB
                    if(TargetID == playerid) return SendClientMessage(playerid, SKY_BLUE, " ** You can't send money to your own bank account! ") && TransferBB
                    if(Amount > dini_Int(myfile, "Cash amount")) return SendClientMessage(playerid, SKY_BLUE, " ** You do not have that amount of money on your bank account! ") && TransferBB
                    if(Amount < dini_Int(myfile, "Cash amount"))
                    {
                        dini_IntSet(myfile, "Cash amount", dini_Int(myfile, "Cash amount") - Amount); dini_IntSet(targetfile, "Cash amount", dini_Int(targetfile, "Cash amount") + Amount);
                        format(mystring, sizeof mystring, " ** You transfered $%i to %s his bank account ", Amount, TargetID);
                        format(targetstring, sizeof targetstring, " ** %s transfered $%i to your bank account ", cast, Amount);
                        SendClientMessage(playerid, SKY_BLUE, mystring); SendClientMessage(TargetID, SKY_BLUE, targetstring);
                    }
                } else {
                    return SendClientMessage(playerid, SKY_BLUE, " ** playerid amount") && TransferBB
                }
            } else {
                return SendClientMessage(playerid, SKY_BLUE, " ** Please fill in something ")&& TransferBB
            }
        }
        else if(!response)
        {
            Bankhome
        }
    }
Last piece is way more organized
Reply
#6

Wesley221, don't be a noob, press SHIFT+TAB once - it will delete indentation by one tab
Reply
#7

I know if you press shift+tab once it goes back one tab. I just missunderstood you, no need to call me a noob immediately.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)