SA-MP Forums Archive
Cant fix this 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: Cant fix this loose indentation -.- (/showthread.php?tid=378409)



Cant fix this loose indentation -.- - RLGaming - 17.09.2012

Code:
Код:
stock CountLockers()
{
     new Lcount;
     for(new x=1; x < MAX_LOCKERS_POINT;x++)
     {
	new path[100];
	for(new lockerid = 1; lockerid < MAX_LOCKERS_POINT; lockerid++)
	{
		format(path,sizeof(path),"/Factions/Locker%d.ini", lockerid);
		if(fexist(path))
	{
		LockersPointCreated[lockerid] = 1;
		return 1;
	}
		else
	{
		LockersPointCreated[lockerid] = 0;
		return 1;
		}
	}
	}
	return Lcount;
}
I cannot fix this loose indentation, so annoying -.-

Can anyone fix it please, the loose indentation is on this line:
Код:
return Lcount;
+rep to anyone who can fix it


Re: Cant fix this loose indentation -.- - Seven_of_Nine - 17.09.2012

Код:
stock CountLockers() {
    new Lcount;
    for(new x=1; x < MAX_LOCKERS_POINT;x++) {
		new path[100];
		for(new lockerid = 1; lockerid < MAX_LOCKERS_POINT; lockerid++) {
			format(path,sizeof(path),"/Factions/Locker%d.ini", lockerid);
			if(fexist(path)) {
				LockersPointCreated[lockerid] = 1;
				return 1;
			} else {
				LockersPointCreated[lockerid] = 0;
				return 1;
			}
		}
	}
	return Lcount;
}
this is how it should look like
also, if you are bad with indentation, use #pragma tabsize 0, even if it's not recommended


Re: Cant fix this loose indentation -.- - vIBIENNYx - 17.09.2012

Код:
stock CountLockers()
{
     new Lcount;
     for(new x=1; x < MAX_LOCKERS_POINT;x++)
     {
	new path[100];
	for(new lockerid = 1; lockerid < MAX_LOCKERS_POINT; lockerid++)
	{
		format(path,sizeof(path),"/Factions/Locker%d.ini", lockerid);

		if(fexist(path))
                {
		        LockersPointCreated[lockerid] = 1;
		        return 1;
	        }
	        else
	        {
		        LockersPointCreated[lockerid] = 0;
		        return 1;
		}
	}
     }
     return Lcount;
}



Re: Cant fix this loose indentation -.- - RLGaming - 17.09.2012

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
Код:
stock CountLockers() {
    new Lcount;
    for(new x=1; x < MAX_LOCKERS_POINT;x++) {
		new path[100];
		for(new lockerid = 1; lockerid < MAX_LOCKERS_POINT; lockerid++) {
			format(path,sizeof(path),"/Factions/Locker%d.ini", lockerid);
			if(fexist(path)) {
				LockersPointCreated[lockerid] = 1;
				return 1;
			} else {
				LockersPointCreated[lockerid] = 0;
				return 1;
			}
		}
	}
	return Lcount;
}
this is how it should look like
also, if you are bad with indentation, use #pragma tabsize 0, even if it's not recommended
Thanks, fixed it!

Repped!


Re: Cant fix this loose indentation -.- - Kaperstone - 17.09.2012

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
this is how it should look like
also, if you are bad with indentation, use #pragma tabsize 0, even if it's not recommended
Do you know why its not recommended ?


Re: Cant fix this loose indentation -.- - Riddy - 17.09.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
Don't EVER do this! And Seven_of_Nine, telling people to do it is by definition recommending it!
Mind explaining why.


Re: Cant fix this loose indentation -.- - Kaperstone - 17.09.2012

Quote:
Originally Posted by Riddy
Посмотреть сообщение
Mind explaining why.
Use it instead :
http://dracoblue.net/tidy/pawn/


Re: Cant fix this loose indentation -.- - Riddy - 17.09.2012

Quote:
Originally Posted by xkirill
Посмотреть сообщение
I've never even use #pragma tabsize 0, just wondered why it isnt recommended.


Re: Cant fix this loose indentation -.- - AtItsMax - 17.09.2012

Quote:
Originally Posted by Riddy
Посмотреть сообщение
I've never even use #pragma tabsize 0, just wondered why it isnt recommended.
Because
pawn Код:
#pragma tabsize 0
avoids every warning big one or minor one.


Re: Cant fix this loose indentation -.- - Glint - 17.09.2012

Quote:
Originally Posted by xkirill
Посмотреть сообщение
That one is broken try to use this one http://codegenerators.pl/indent it works like a charm for me.