warning loose indentation
#1

i want a help when i compile this warning shows i tried many times but i cant fix
Код:
23798
pawn
pawn Код:
--------------------Selection Screen Colors-----------------------------
        switch (classid)
        {
        //-------------------------------SF Worker
        case 0:
        {
24771

pawn Код:
}
    }
    return 1;
}
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");
Reply
#2

These errors occur due to brackets placed in wrong formats.
Reply
#3

Are you there in skype pm me and can you say how to fix it
Reply
#4

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.
Reply
#5

i did not understood can you say line warning by
Reply
#6

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.
Reply
#7

okay let me check
Reply
#8

You might learn something from this: http://en.wikipedia.org/wiki/Indent_style
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)