Loose Indentation
#3

It kinda means your code looks messy.

pawn Код:
//Bad indentation:
CMD:mycommand(playerid, params[])
{
    if (IsPlayerAdmin(playerid)){
        SendClientMessage(playerid, -1, "Hello RCON admin!");
        return 1;
      } //This one; it should be at the same vertical line as the if statement
      SendClientMessage(playerid, -1, "Hello player!"); //Samewise..
    return 1;
}

//Good indentation:
CMD:mycommand(playerid, params[])
{
    if (IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, -1, "Hello RCON admin!");
        return 1;
    }
    SendClientMessage(playerid, -1, "Hello player!");
    return 1;
}
By the way,

1- it is really not needed to check if the player is online or not.. if a player is offline they cannot use the command thus it will not be called
2- your command stops (returning 1) if the player using the command is online, so you'll never be able to use that command

EDIT:
@David{somethingelse};
Please consider explaining WHY he had the warning. If you don't explain what was wrong, they'll never learn.
Reply


Messages In This Thread
Loose Indentation - by ScriptFohLife - 13.11.2014, 20:41
Re: Loose Indentation - by DavidBilla - 13.11.2014, 20:46
Re: Loose Indentation - by Kwarde - 13.11.2014, 20:46
Re: Loose Indentation - by ScriptFohLife - 13.11.2014, 20:58
Re: Loose Indentation - by Runn3R - 13.11.2014, 21:01
Re: Loose Indentation - by Kwarde - 13.11.2014, 21:03
Re: Loose Indentation - by HeLiOn_PrImE - 14.11.2014, 10:11

Forum Jump:


Users browsing this thread: 1 Guest(s)