SA-MP Forums Archive
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)
+--- Thread: warning 217: loose indentation (/showthread.php?tid=571922)



warning 217: loose indentation - tboysamp - 23.04.2015

Код:
			case CHECKPOINT_HARVEST:
			{
   				        new vehicleid = GetPlayerVehicleID(playerid);
			            CheckP[playerid] = 0;
				        if(vehicleid >= 155 && vehicleid <= 158) {
					    if(Harvesting[playerid] > 0) {
						gPlayerCheckpointStatus[playerid] = CHECKPOINT_HARVEST;
						Harvesting[playerid] += 1;
						if(Harvesting[playerid] != 28) {
							SendClientMessage(playerid,COLOR_GRAD3,"[HINT]: Head to the next checkpoint.");
						}
	// farm check
						if(Harvesting[playerid] == 2) {
							SetPlayerCheckpoint(playerid,-1370.9534,-1483.5564,102.1333,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 3) {
							SetPlayerCheckpoint(playerid,-1358.5763,-1503.1222,102.3323,5.02);
						}
	// farm check
						else if(Harvesting[playerid] == 4) {
							SetPlayerCheckpoint(playerid,-1365.5188,-1519.2660,102.4613,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 5) {
							SetPlayerCheckpoint(playerid,-1367.1089,-1544.0913,102.4136,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 6) {
							SetPlayerCheckpoint(playerid,-1358.9913,-1555.9219,102.4460,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 7) {
							SetPlayerCheckpoint(playerid,-1355.6049,-1578.1782,102.4907,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 8) {
							SetPlayerCheckpoint(playerid,-1365.6514,-1596.2019,102.4908,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 9) {
							SetPlayerCheckpoint(playerid,-1378.5776,-1604.9301,102.4908,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 10) {
							SetPlayerCheckpoint(playerid,-1397.8253,-1594.3827,102.4276,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 11) {
							SetPlayerCheckpoint(playerid,-1398.1288,-1566.4194,102.0638,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 12) {
							SetPlayerCheckpoint(playerid,-1397.7042,-1543.2629,101.9672,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 13) {
							SetPlayerCheckpoint(playerid,-1404.3562,-1484.2096,101.8919,5.0);
						}
	// farm check
						else if(Harvesting[playerid] == 14) {
							SendClientMessage(playerid,COLOR_BLUE,"[INFO]: You have completed your harvest and gained $550.");
							GivePlayerCash(playerid,550);
							Harvesting[playerid] = 0;
							DisablePlayerCheckpoint(playerid);
							gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
							SetVehicleToRespawn(GetPlayerVehicleID(playerid));
							JobDelay[playerid] = 900;
							GameDrawForPlayer(playerid,"~w~Mission ~g~Passed ~n~~y~+$550",2000);
						}
					}
				}
	            else {//warning 217: loose indentation here
	            SendClientMessage(playerid,COLOR_GREEN,"You are not in a Harvester.");
				}
			}



Re: warning 217: loose indentation - Konstantinos - 23.04.2015

https://sampwiki.blast.hk/wiki/Errors_Li...se_indentation


Re: warning 217: loose indentation - Jimmy0wns - 23.04.2015

How hard can it be to put down 4 spaces (or TAB).

PHP код:
case CHECKPOINT_HARVEST:
{
    new 
vehicleid GetPlayerVehicleID(playerid);
    
CheckP[playerid] = 0;
    if(
vehicleid >= 155 && vehicleid <= 158) {
        if(
Harvesting[playerid] > 0) {
            
gPlayerCheckpointStatus[playerid] = CHECKPOINT_HARVEST;
            
Harvesting[playerid] += 1;
            if(
Harvesting[playerid] != 28) {
                
SendClientMessage(playerid,COLOR_GRAD3,"[HINT]: Head to the next checkpoint.");
            }
            
// farm check
            
if(Harvesting[playerid] == 2) {
                
SetPlayerCheckpoint(playerid,-1370.9534,-1483.5564,102.1333,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 3) {
                
SetPlayerCheckpoint(playerid,-1358.5763,-1503.1222,102.3323,5.02);
            }
            
// farm check
            
else if(Harvesting[playerid] == 4) {
                
SetPlayerCheckpoint(playerid,-1365.5188,-1519.2660,102.4613,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 5) {
                
SetPlayerCheckpoint(playerid,-1367.1089,-1544.0913,102.4136,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 6) {
                
SetPlayerCheckpoint(playerid,-1358.9913,-1555.9219,102.4460,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 7) {
                
SetPlayerCheckpoint(playerid,-1355.6049,-1578.1782,102.4907,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 8) {
                
SetPlayerCheckpoint(playerid,-1365.6514,-1596.2019,102.4908,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 9) {
                
SetPlayerCheckpoint(playerid,-1378.5776,-1604.9301,102.4908,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 10) {
                
SetPlayerCheckpoint(playerid,-1397.8253,-1594.3827,102.4276,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 11) {
                
SetPlayerCheckpoint(playerid,-1398.1288,-1566.4194,102.0638,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 12) {
                
SetPlayerCheckpoint(playerid,-1397.7042,-1543.2629,101.9672,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 13) {
                
SetPlayerCheckpoint(playerid,-1404.3562,-1484.2096,101.8919,5.0);
            }
            
// farm check
            
else if(Harvesting[playerid] == 14) {
                
SendClientMessage(playerid,COLOR_BLUE,"[INFO]: You have completed your harvest and gained $550.");
                
GivePlayerCash(playerid,550);
                
Harvesting[playerid] = 0;
                
DisablePlayerCheckpoint(playerid);
                
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
                
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
                
JobDelay[playerid] = 900;
                
GameDrawForPlayer(playerid,"~w~Mission ~g~Passed ~n~~y~+$550",2000);
            }
        }
    }
    else {
//warning 217: loose indentation here
        
SendClientMessage(playerid,COLOR_GREEN,"You are not in a Harvester.");
    }




Re: warning 217: loose indentation - tboysamp - 23.04.2015

thanks Jimmy & Konstantinos thanks for the information guys appreciate it


Re: warning 217: loose indentation - MP2 - 23.04.2015

You should really learn how to use arrays..