13.11.2014, 20:46
It kinda means your code looks messy.
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.
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;
}
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.