Loose identation - 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:  Loose identation (
/showthread.php?tid=606248)
 
Loose identation - 
Fantje -  01.05.2016
I got this problem:
PHP код:
: warning 217: loose indentation 
 
PHP код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
     if(checkpointid == CP[First])
     {
         if(UnderAttack[First] == 1)
         {
             SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!");
         }
         else if(gTeam[playerid] == tCP[First])
         {
             SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!");
         }
         else if(gTeam[playerid] == TEAM_NONE)
         {
             SendClientMessage(playerid, 0xFF0000FF,"You have no team so you cannot capture!");
         }
         else
         {
               UnderAttack[First] = 1;
            timer[playerid][First] = SetTimerEx("SetCaptureZone", 25000, false,"i",playerid);
            CountTime[playerid] = SetTimerEx("CountDown", 1, false,"i", playerid);
            iCP[playerid] = First;
            InCP[playerid][First] = 1;
            Captured[First] = 0;
            if(gTeam[playerid] == SWAT)
         {
             GangZoneFlashForAll(Zone[First], ARMY_COLOR);
                 }
            else if(gTeam[playerid] == TERRORISTS)
         {
            GangZoneFlashForAll(Zone[First], COLOR_RED);
         }
            new string[128], name[MAX_PLAYER_NAME+1];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string),"%s is trying to capture theFirst",name);
            SendClientMessageToAll(ARMY_COLOR, string);
            }
        }
            return 1; //THIS IS THE LINE THAT GIVES THE ERROR
} 
 Help me please 
 
Re: Loose identation - 
bgedition -  01.05.2016
line up the return value with the code above(the last curly bracket)
Re: Loose identation - 
Fantje -  01.05.2016
EDIT: Fixed. Thank you
Re: Loose identation - 
bgedition -  01.05.2016
Here, try this:
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) 
{ 
	if(checkpointid == CP[First]) 
	{ 
		if(UnderAttack[First] == 1) 
		{ 
			SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!"); 
		} 
		else if(gTeam[playerid] == tCP[First]) 
		{ 
			SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!"); 
		} 
		else if(gTeam[playerid] == TEAM_NONE) 
		{ 
			SendClientMessage(playerid, 0xFF0000FF,"You have no team so you cannot capture!"); 
		} 
		else 
		{ 
			UnderAttack[First] = 1; 
			timer[playerid][First] = SetTimerEx("SetCaptureZone", 25000, false,"i",playerid); 
			CountTime[playerid] = SetTimerEx("CountDown", 1, false,"i", playerid); 
			iCP[playerid] = First; 
			InCP[playerid][First] = 1; 
			Captured[First] = 0; 
			if(gTeam[playerid] == SWAT) 
			{ 
				GangZoneFlashForAll(Zone[First], ARMY_COLOR); 
			} 
			else if(gTeam[playerid] == TERRORISTS) 
			{ 
				GangZoneFlashForAll(Zone[First], COLOR_RED); 
			} 
			new string[128], name[MAX_PLAYER_NAME+1]; 
			GetPlayerName(playerid, name, sizeof(name)); 
			format(string, sizeof(string),"%s is trying to capture theFirst",name); 
			SendClientMessageToAll(ARMY_COLOR, string); 
		} 
	} 
	return 1;
}