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=485871)



warning 217: loose indentation - botak - 06.01.2014

I have one warning. C:\Users\User\Desktop\Untitled.pwn(136) : warning 217: loose indentation
how i can fix it ?

This my code
Код:
	sendername[strfind(sendername,"_")] = ' ';
		format(string, sizeof(string), "%s Says: %s", sendername, text);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		new lengthtime = strlen(text);
        new time = lengthtime*50;
		ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
	return true;
    }
    return false;
}
and the warning is here
Код:
return true;



Re: warning 217: loose indentation - CrazyGab - 06.01.2014

It's due to the fact you got your code a bit messed up when it comes to the tabbing.

You want code to look like this

Код:
if(IAmHelping){

 Analyse();
     debug();
 fix();

}
Not like this:
Ё
Код:
if(IAmHelping) {
   Analyse();
                                   Debug();
fix();
}
'

So aline your code with eachother and it should be good.


Source: https://sampwiki.blast.hk/wiki/Errors_Li...ded_assignment

Note: If you prefer to keep it your way, you could always add this:
Код:
#pragma tabsize 0
at the top to ignore the warning.


Re: warning 217: loose indentation - Sinner - 06.01.2014

Use proper indentation.


Re: warning 217: loose indentation - botak - 06.01.2014

Quote:
Originally Posted by Sinner
Посмотреть сообщение
Use proper indentation.
Not Work
and sorry this is a full code

Код:
public OnPlayerText(playerid, text[])
{

	if (realchat)
	{
      	new sendername[MAX_PLAYER_NAME], string[128];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		sendername[strfind(sendername,"_")] = ' ';
        format(string, sizeof(string), "%s Says: %s", sendername, text);
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    new lengthtime = strlen(text);
        new time = lengthtime*50;
    ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
    return true;
    }
    return false;
}



Re: warning 217: loose indentation - CrazyGab - 06.01.2014

Try this:

Код:
public OnPlayerText(playerid, text[])
{
	if (realchat)
	{
		new sendername[MAX_PLAYER_NAME], string[128];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		sendername[strfind(sendername,"_")] = ' ';
		format(string, sizeof(string), "%s Says: %s", sendername, text);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		new lengthtime = strlen(text);
		new time = lengthtime*50;
		ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
		return true;
	}
    
	return false;
}



Re: warning 217: loose indentation - denom - 06.01.2014

It should be like this

pawn Код:
public OnPlayerText(playerid, text[])
{
    if (realchat)
    {
        new sendername[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, sendername, sizeof(sendername));
        sendername[strfind(sendername,"_")] = ' ';
        format(string, sizeof(string), "%s Says: %s", sendername, text);
        ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        new lengthtime = strlen(text);
        new time = lengthtime*50;
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
        return true;
        }
    return false;
}



Re: warning 217: loose indentation - botak - 06.01.2014

Quote:
Originally Posted by CrazyGab
Посмотреть сообщение
Try this:

Код:
public OnPlayerText(playerid, text[])
{
	if (realchat)
	{
		new sendername[MAX_PLAYER_NAME], string[128];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		sendername[strfind(sendername,"_")] = ' ';
		format(string, sizeof(string), "%s Says: %s", sendername, text);
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		new lengthtime = strlen(text);
		new time = lengthtime*50;
		ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
		return true;
	}
    
	return false;
}
Thank's It's work perfectly REP+