loose indentation HELP FAST!!!! -
robibacsii - 10.12.2014
warning 217: loose indentation
Code:
PHP код:
CMD:premiums ( playerid )
{
new c = 0, str[128];
if ( PlayerInfo[playerid][LoggedIn] == 0 ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You must be logged in!");
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][VIP] >= 1)
{
c++;
if (c==1)
{
format(str, sizeof(str), ""REDORANGE"Premium member(s)/donators online:\n{%06x}%s(%d)\n", (GetPlayerColor(i) >>> 8), GetName(i), i);
}
if (c >=2)
{
format(str, sizeof(str), "\n%s{%06x}%s(%d)", str, (GetPlayerColor(i) >>> 8), GetName(i), i);
}
}
}
}
if (c == 0) return SendClientMessage(playerid, -1, ""STEELBLUE"SERVER: There are no donators/premiums online.");
ShowPlayerDialog(playerid, DIALOG_VIPS, DIALOG_STYLE_MSGBOX, ""RED"Premium/Donators Online:", str, "OK", "");
return 1;
}
What's the problem?
Re: loose indentation HELP -
bogushas - 10.12.2014
PHP код:
CMD:remiums ( playerid )
{
new c = 0, str[128];
if ( PlayerInfo[playerid][LoggedIn] == 0 ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You must be logged in!");
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][VIP] >= 1)
{
c++;
if (c==1)
{
format(str, sizeof(str), ""REDORANGE"Premium member(s)/donators online:\n{%06x}%s(%d)\n", (GetPlayerColor(i) >>> , GetName(i), i);
}
else if (c >=2)
{
format(str, sizeof(str), "\n%s{%06x}%s(%d)", str, (GetPlayerColor(i) >>> , GetName(i), i);
}
}
}
}
if (c == 0) return SendClientMessage(playerid, -1, ""STEELBLUE"SERVER: There are no donators/premiums online.");
ShowPlayerDialog(playerid, DIALOG_VIPS, DIALOG_STYLE_MSGBOX, ""RED"Premium/Donators Online:", str, "OK", "");
return 1;
}
Re: loose indentation HELP -
robibacsii - 10.12.2014
Then what do I need to do?
Re: loose indentation HELP -
Glossy42O - 10.12.2014
Код:
CMD:remiums ( playerid )
{
new c = 0, str[128];
if ( PlayerInfo[playerid][LoggedIn] == 0 ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You must be logged in!");
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][VIP] >= 1)
{
c++;
if (c==1)
{
format(str, sizeof(str), ""REDORANGE"Premium member(s)/donators online:\n{%06x}%s(%d)\n", (GetPlayerColor(i) >>> , GetName(i), i);
}
if (c >=2)
{
format(str, sizeof(str), "\n%s{%06x}%s(%d)", str, (GetPlayerColor(i) >>> , GetName(i), i);
}
}
}
}
if (c == 0) return SendClientMessage(playerid, -1, ""STEELBLUE"SERVER: There are no donators/premiums online.");
ShowPlayerDialog(playerid, DIALOG_VIPS, DIALOG_STYLE_MSGBOX, ""RED"Premium/Donators Online:", str, "OK", "");
return 1;
}
Re: loose indentation HELP -
robibacsii - 10.12.2014
Maybe someone help?
Re: loose indentation HELP -
Schneider - 10.12.2014
That's terrible Stuun!
Re: loose indentation HELP -
robibacsii - 10.12.2014
True.
Maybe if I cry, then I will get a good answer.
Re: loose indentation HELP -
Schneider - 10.12.2014
That warnings says the indentation of your script is bad. You have to add an extra tab (or 4 spaces) in front of each line after you use an opening-bracket '{' and remove a tab (or 4 spaces) in front of each line after you used a closing-bracket '}'. This will make your script more readable. Without proper indentation your script will look like a mess. (Like Stuun's code here above).
Example:
pawn Код:
cmd:hello(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, -1, "Hello");
RemovePlayerFromVehicle(playerid);
}
else
{
SendClientMessage(playerid, -1, "Bye");
}
}
return 1;
}
Re: loose indentation HELP -
robibacsii - 10.12.2014
Can you fix my code and send me it..
I don't see the problem
Run time Error 19 HELP! -
robibacsii - 11.12.2014
When I compile my script everithyng is OK but when I want to run my server it says: Run time Error 19 File or Function is not found!
Can someone help me?