warning 217: loose indentation
#1

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;
Reply
#2

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

Use proper indentation.
Reply
#4

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

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

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

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+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)