SA-MP Forums Archive
[Tutorial] How to fix warning 217: 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to fix warning 217: loose indentation (/showthread.php?tid=256961)

Pages: 1 2


Re: Respuesta: How to fix warning 217: loose indentation - Ash. - 10.04.2013

Quote:
Originally Posted by Christian7073
View Post
you can use
#pragma tabsize 0
Quote:
Originally Posted by sonnkz
View Post
i in this problem use #pragma tabsize 0 and solved problems with Loose identation
Fix this, then:
Code:
#include <a_samp>

public OnFilterScriptInit()
{
new iVar, iVar2, iVar3;
//some magical way of assigning data to the variables from any sort of input
if(iVar == iVar2)
{
if(iVar2 == iVar3)
{
if(iVar == iVar3)
{
print("they're all equal!");
}
}
}
}
}
From that I can't see what's wrong (although I do know what's wrong obviously). However, from this:
Code:
#include <a_samp>

public OnFilterScriptInit()
{
	new iVar, iVar2, iVar3;
	//some magical way of assigning data to the variables from any sort of input
	if(iVar == iVar2)
	{
		if(iVar2 == iVar3)
		{
			if(iVar == iVar3)
			{
				print("they're all equal!");
			}
		}
	}
	}
}
That is exactly why you should indent rather than using your #pragma tabsize directive. (It's also why I refuse to help people with ridiculous indentation)

On topic - this is a good tutorial, but some people are too ignorant to listen because "the #pragma tabsize exists so we don't need this lololol"...


Re: How to fix warning 217: loose indentation - MP2 - 11.04.2013

If I was Kye I'd remove the fucking thing so people are FORCED to indent. In fact I'd change the WARNING to an ERROR.


Re: How to fix warning 217: loose indentation - Patrick - 11.04.2013

Quote:
Originally Posted by MP2
View Post
If I was Kye I'd remove the fucking thing so people are FORCED to indent. In fact I'd change the WARNING to an ERROR.
I Agree with you MP2


Re: How to fix warning 217: loose indentation - biduaxe - 29.07.2013

help me fix this
Quote:

C:\Users\Admin\Downloads\Compressed\LSLRP 0.3e\gamemodes\lslrp.pwn(4600) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	    new str[30];
	    format(str,sizeof(str),"~W~%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
	    GameTextForPlayer(playerid, str, 1000, 1);
	    
		if(gTeam[playerid] >= 3)
		{
		if (IsACopCar(vehicleid) && !ispassenger)
		{
			if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3) {}
		    else { SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle"); }
		}
		if (IsALSFMD(vehicleid) && !ispassenger)
		{
		    if(PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4) { }
		    else { SetPlayerCriminal(playerid,255, "Stealing An Ambulance"); }
		}
	}
            return 1;



Re: How to fix warning 217: loose indentation - maaz - 05.12.2013

Y_Less we can even use this code right

<removed>


Re: How to fix warning 217: loose indentation - iZN - 05.12.2013

Quote:
Originally Posted by maaz
View Post
Y_Less we can even use this code right

<removed>
Worst method. Indentation is important!


Re: How to fix warning 217: loose indentation - maaz - 05.12.2013

its easy for the newbies right ??


Re: How to fix warning 217: loose indentation - Y_Less - 05.12.2013

Quote:
Originally Posted by maaz
View Post
Y_Less we can even use this code right

<removed>
From the forum rules:

Quote:
  • Banned Code - There is a certain "#pragma" that can be used to hide significant warnings and produce unreadable code - DO NOT advocate its use if you know what it is; it is TERRIBLE practice and we want to get rid of it.
So, in short - no! In fact, if you had read any of my other posts in this topic you would have seen the same stated quite clearly and repeatedly.

Quote:
Originally Posted by maaz
View Post
its easy for the newbies right ??
Just because something is easy does not mean it is good or should be done. If you are only concerned with ease stop scripting right now - that is the easiest path.


Re: How to fix warning 217: loose indentation - maaz - 06.12.2013

Thanks For That and even sorry
I was thinking that this is correct way.