Loose identation
#1

I got this problem:

PHP код:
warning 217loose indentation 
PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
     if(
checkpointid == CP[First])
     {
         if(
UnderAttack[First] == 1)
         {
             
SendClientMessage(playerid0xFF0000FF,"This zone is already being captured!");
         }
         else if(
gTeam[playerid] == tCP[First])
         {
             
SendClientMessage(playerid0xFF0000FF,"This zone is already being captured!");
         }
         else if(
gTeam[playerid] == TEAM_NONE)
         {
             
SendClientMessage(playerid0xFF0000FF,"You have no team so you cannot capture!");
         }
         else
         {
               
UnderAttack[First] = 1;
            
timer[playerid][First] = SetTimerEx("SetCaptureZone"25000false,"i",playerid);
            
CountTime[playerid] = SetTimerEx("CountDown"1false,"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(playeridnamesizeof(name));
            
format(stringsizeof(string),"%s is trying to capture theFirst",name);
            
SendClientMessageToAll(ARMY_COLORstring);
            }
        }
            return 
1//THIS IS THE LINE THAT GIVES THE ERROR

Help me please
Reply
#2

line up the return value with the code above(the last curly bracket)
Reply
#3

EDIT: Fixed. Thank you
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)