Need help with indentations on Pawno
#1

Is there like an auto-fixer or something that could change this (as an example):
pawn Код:
public OnPlayerDisconnect(playerid, reason) //This is From my Script Simple Join and Leave Messages


{


    new name[24];


        GetPlayerName(playerid, name, sizeof name);


        new string[128];





    switch(reason)


    {


        case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", name);


        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", name);


        case 2: format(string, sizeof(string), "%s has left the server. (Kicked/Banned)", name);


    }


    SendClientMessageToAll(0x880088FF, string);


        return 1;


}
To something with NO indentation errors. I really need help, someone fixed my script on pastebin, but now since i got my one with errors fixed off of pastebin, it has a lot of indentation errors. Any help here?
Reply
#2

wrong indention is actually a warning, not an error, so your script will work even if it has these errors. although, it's always best to have no errors nor warnings after compilation. as for the tool that you're asking, i haven't seen one yet. just take your time on fixing the indentions.
Reply
#3

pawn Код:
public OnPlayerDisconnect(playerid, reason)       //This is From my Script Simple Join and Leave Messages

{

    new name[24];

    GetPlayerName(playerid, name, sizeof name);

    new string[128];

    switch(reason) {

        case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", name);

        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", name);

        case 2: format(string, sizeof(string), "%s has left the server. (Kicked/Banned)", name);

    }

    SendClientMessageToAll(0x880088FF, string);

    return 1;

}
Use, http://dracoblue.net/tidy/pawn/ it's pretty useful.
Reply
#4

Quote:
Originally Posted by Kitten
Посмотреть сообщение
pawn Код:
public OnPlayerDisconnect(playerid, reason)       //This is From my Script Simple Join and Leave Messages

{

    new name[24];

    GetPlayerName(playerid, name, sizeof name);

    new string[128];

    switch(reason) {

        case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", name);

        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", name);

        case 2: format(string, sizeof(string), "%s has left the server. (Kicked/Banned)", name);

    }

    SendClientMessageToAll(0x880088FF, string);

    return 1;

}
it's only an example, which means that most of the codes or all of them are messed up in their indentions.
Reply
#5

Quote:
Originally Posted by Skribblez
Посмотреть сообщение
it's only an example, which means that most of the codes or all of them are messed up in their indentions.
Ya pretty much, I have a lot of things to fix the indent of if i am doing it myself.
Reply
#6

yeah, i understood. like i said, haven't found any tool that fixes code indention especially for pawn. just do it by yourself, eventually you'll be surprised that every indention is fixed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)