warning 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: warning loose indentation (
/showthread.php?tid=522246)
warning loose indentation -
ReD_DeVi - 26.06.2014
i want a help when i compile this warning shows i tried many times but i cant fix
pawn
pawn Код:
--------------------Selection Screen Colors-----------------------------
switch (classid)
{
//-------------------------------SF Worker
case 0:
{
24771
38119
pawn Код:
strmid(VehicleInfo[vehicleID][owner], DEFAULT_OWNER, 0, strlen(DEFAULT_OWNER), 255);
VehicleInfo[vehicleID][bought] = 0;
VehicleInfo[vehicleID][secure] = 0;
GivePlayerMoney(playerid, VehicleInfo[vehicleID][vehiclecost]);
// format(string, sizeof(string), "You just sold your %s for $%d, enjoy the walk!!", VehicleInfo[vehicleID][name], VehicleInfo[vehicleID][vehiclecost]);
// SendClientMessage(playerid, COLOR_BRIGHTRED, string);
SavePlayer(playerid);
return 1;
}
2645
pawn Код:
text_Top5[0] = TextDrawCreate(39.000000, 181.000000, "TOP SHOOTERS");
Re: warning loose indentation -
Rittik - 26.06.2014
These errors occur due to
brackets placed in wrong formats.
Re: warning loose indentation -
ReD_DeVi - 26.06.2014
Are you there in skype pm me and can you say how to fix it
Re: warning loose indentation -
Rittik - 26.06.2014
Okay, I can explain you.
Код:
for(new i=0;i<MAX_PLAYERS;i++)
{// The place where you opened the bracket
if(IsPlayerConnected(i))
{// The place where you opened the bracket
printf("Hello");
}//The place where you close the bracket should be equal to the place of the opened bracket.
}//The place where you close the bracket should be equal to the place of the opened bracket.
Re: warning loose indentation -
ReD_DeVi - 26.06.2014
i did not understood can you say line warning by
Re: warning loose indentation -
Rittik - 26.06.2014
The compiler will issue this warning if the code indentation is 'loose', example:
Good:
Код:
if(condition)
{
action();
result();
}
Bad:
Код:
if(condition)
{
action();
result();
}
Indentation means to push (indent) text along from the left of the page (by pressing the TAB key). This is common practice in programming to make code easier to read. This warning also exists to avoid dangling-else problem.
Source:- wiki.sa-mp.com
This might help you.
Re: warning loose indentation -
ReD_DeVi - 26.06.2014
okay let me check
Re: warning loose indentation -
RedFusion - 26.06.2014
You might learn something from this:
http://en.wikipedia.org/wiki/Indent_style