warning 217: loose indentation
#1

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

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

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

Код:
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;
        }
}
Reply
#5

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

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

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

place in the middle section defines / incluides

pawn Код:
#pragma tabsize 0
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)