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



warning 217: loose indentation - Saddin - 11.12.2012

It comes in paused.inc :

Код:
pawno\include\paused.inc(38) : warning 217: loose indentation
pawno\include\paused.inc(40) : warning 217: loose indentation
pawno\include\paused.inc(62) : warning 217: loose indentation
pawno\include\paused.inc(73) : warning 217: loose indentation
Here are the lines for paused.inc(38):

Код:
Hook:P_OnPlayerDisconnect(playerid)
{
        KillTimer(g_Timer[playerid]);
    g_Requesting[playerid] = false;
    g_IsPaused[playerid] = false;
        return 1;
}



Re: warning 217: loose indentation - goviscrap - 11.12.2012

Here try this:

Код:
Hook:P_OnPlayerDisconnect(playerid)
{
    KillTimer(g_Timer[playerid]);
    g_Requesting[playerid] = false;
    g_IsPaused[playerid] = false;
    return 1;
}
You got too much "space"


Re: warning 217: loose indentation - DiGiTaL_AnGeL - 11.12.2012

pawn Код:
Hook:P_OnPlayerDisconnect(playerid)
{
        KillTimer(g_Timer[playerid]);
        g_Requesting[playerid] = false;
        g_IsPaused[playerid] = false;
        return 1;
}
And show me the lines from 60 to 75...


Re: warning 217: loose indentation - Saddin - 11.12.2012

Код:
public C_Paused(playerid)
{
    if(GetTickCount()-g_Paused[playerid] > TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != true && InvalidStates(playerid) != 1)
        {
                OnPlayerPause(playerid);
                g_IsPaused[playerid] = true;
        }
        else if(GetTickCount()-g_Paused[playerid] < TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != false && InvalidStates(playerid) != 1)
        {
            OnPlayerUnPause(playerid);
            g_IsPaused[playerid] = false;
        }
        return 1;
}

stock IsPlayerPaused(playerid)
{
        return g_IsPaused[playerid];
}

stock InvalidStates(playerid)
{
        new pState = GetPlayerState(playerid);
    if(pState == 0 || pState == 7)
    {
                return 1;
        }
        else
        {
                return 0;
        }
}



Re: warning 217: loose indentation - XtremeR - 11.12.2012

this will fix it:
pawn Код:
public C_Paused(playerid)
{
if(GetTickCount()-g_Paused[playerid] > TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != true && InvalidStates(playerid) != 1)
{
OnPlayerPause(playerid);
g_IsPaused[playerid] = true;
}
else if(GetTickCount()-g_Paused[playerid] < TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != false && InvalidStates(playerid) != 1)
{
OnPlayerUnPause(playerid);
g_IsPaused[playerid] = false;
}
        return 1;
}

stock IsPlayerPaused(playerid)
{
return g_IsPaused[playerid];
}

stock InvalidStates(playerid)
{
new pState = GetPlayerState(playerid);
if(pState == 0 || pState == 7)
{
return 1;
}
else
{
return 0;
}
}



Re: warning 217: loose indentation - goviscrap - 11.12.2012

try this also:
Код:
public C_Paused(playerid)
{
    if(GetTickCount()-g_Paused[playerid] > TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != true && InvalidStates(playerid) != 1)
        {
                OnPlayerPause(playerid);
                g_IsPaused[playerid] = true;
        }
        else if(GetTickCount()-g_Paused[playerid] < TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != false && InvalidStates(playerid) != 1)
        {
        	OnPlayerUnPause(playerid);
        	g_IsPaused[playerid] = false;
        }
        return 1;
}

stock IsPlayerPaused(playerid)
{
        return g_IsPaused[playerid];
}

stock InvalidStates(playerid)
{
    new pState = GetPlayerState(playerid);
    if(pState == 0 || pState == 7)
    {
    	return 1;
    }
    else
    {
    	return 0;
    }
}



Re: warning 217: loose indentation - Plovix - 11.12.2012

Try:

Код:
public C_Paused(playerid)
{
    if(GetTickCount()-g_Paused[playerid] > TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != true && InvalidStates(playerid) != 1)
        {
                OnPlayerPause(playerid);
                g_IsPaused[playerid] = true;
        }
        else if(GetTickCount()-g_Paused[playerid] < TIME_DIF && g_Requesting[playerid] != true && g_IsPaused[playerid] != false && InvalidStates(playerid) != 1)
        {
            OnPlayerUnPause(playerid);
            g_IsPaused[playerid] = false;
        }
        return 1;
}

stock IsPlayerPaused(playerid)
{
        return g_IsPaused[playerid];
}

stock InvalidStates(playerid)
{
    new pState = GetPlayerState(playerid);
    if(pState == 0 || pState == 7)
    return 1;
    return 0;
}
Код:
Hook:P_OnPlayerDisconnect(playerid)
{
    KillTimer(g_Timer[playerid]);
    g_Requesting[playerid] = false;
    g_IsPaused[playerid] = false;
    return 1;
}



Re: warning 217: loose indentation - [RoXx]Okiinho_. - 12.12.2012

place in the middle section defines / incluides

pawn Код:
#pragma tabsize 0



Re: warning 217: loose indentation - LarzI - 12.12.2012

Oh god so much facepalm in this thread.

Instead of saying "do this, do that" and providing stupid code likt he tabsize pragma, which in fact just hides the errors, how about TEACH why this error occurs and how to fix it?

This error occurs because you don't indent your code correctly.
Read upon indentation here: https://sampforum.blast.hk/showthread.php?tid=256961

Edit: You could always paste your code into Notepad++ and install the plugin "TextFx", then navigate in the menu to: TextFx > TextFx Edit > Reindent C++ Code. This will automaticly try to indent your code correctly.