SA-MP Forums Archive
[Ajuda] ~~> loose indentation - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] ~~> loose indentation (/showthread.php?tid=295317)



[Ajuda] ~~> loose indentation - .Skool_. - 05.11.2011

Tive dois erros com os cуdigos de Nickoff й nickon:

pawn Код:
C:\xx\xx\xx\xx\xx.pwn(291) : warning 217: loose indentation

C:\xx\xx\xx\xx\xx.pwn(294) : warning 217: loose indentation
Aqui estгo as linhas dos erros:

pawn Код:
for(new i; i < MAX_PLAYERS; i++)if(IsPlayerConnected(i))ShowPlayerNameTagForPlayer(playerid, i, 0);

for(new i; i < MAX_PLAYERS; i++)if(IsPlayerConnected(i))ShowPlayerNameTagForPlayer(playerid, i, 1);
Cуdigo completo:

pawn Код:
if(strcmp(cmdtext, "/nickoff", true) == 0){SendClientMessage(playerid, 0xFF9900AA, "(INFO): Nicks desativados !"); GameTextForPlayer(playerid,"~w~Nicks ~r~Desativados",1000,6);
for(new i; i < MAX_PLAYERS; i++)if(IsPlayerConnected(i))ShowPlayerNameTagForPlayer(playerid, i, 0);
gNameTags[playerid] = 0; return 1;}
if(strcmp(cmdtext, "/nickon", true) == 0){SendClientMessage(playerid, 0xFF9900AA, "(INFO): Nicks ativados !"); GameTextForPlayer(playerid,"~w~Nicks ~g~Ativado",1000,6);
for(new i; i < MAX_PLAYERS; i++)if(IsPlayerConnected(i))ShowPlayerNameTagForPlayer(playerid, i, 1);
gNameTags[playerid] = 1;return 1; }



Re: AVISOS: ~~> loose indentation - Enderman - 05.11.2011

N coloque o cуdigo assim, ai dara erro msm ¬¬

pawn Код:
if(strcmp(cmdtext, "/nickoff", true) == 0)
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        ShowPlayerNameTagForPlayer(i, i, false);
        SendClientMessage(i, 0xFF9900AA, "(INFO): Nicks desativados !");
        GameTextForPlayer(i,"~w~Nicks ~r~Desativados",1000,6);
        gNameTags[playerid] = 0;
    }
    return 1;
}
if(strcmp(cmdtext, "/nickon", true) == 0)
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        ShowPlayerNameTagForPlayer(i, i, true);
        SendClientMessage(i, 0xFF9900AA, "(INFO): Nicks ativados !");
        GameTextForPlayer(i,"~w~Nicks ~r~Ativado",1000,6);
        gNameTags[playerid] = 1;
    }
    return 1;
}



Re: AVISOS: ~~> loose indentation - Kostas' - 05.11.2011

pawn Код:
if(strcmp(cmdtext, "/nickoff", true) == 0)
{
    for(new i; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i))
            ShowPlayerNameTagForPlayer(playerid, i, 0);
        SendClientMessage(playerid, 0xFF9900AA, "(INFO): Nicks desativados !");
        GameTextForPlayer(playerid,"~w~Nicks ~r~Desativados",1000,6);

        gNameTags[playerid] = 0;
    }
    return 1;
}


if(strcmp(cmdtext, "/nickon", true) == 0)
{
    for(new i; i < MAX_PLAYERS; i++)
        if(IsPlayerConnected(i))
            ShowPlayerNameTagForPlayer(playerid, i, 1);
    SendClientMessage(playerid, 0xFF9900AA, "(INFO): Nicks ativados !");
    GameTextForPlayer(playerid,"~w~Nicks ~g~Ativado",1000,6);
    gNameTags[playerid] = 1;
}


return 1;
}



Re: AVISOS: ~~> loose indentation - .Skool_. - 05.11.2011

Obrigado a vocкs 2!