loose indentation HELP
#1

warning 217: loose indentation



Code:
PHP код:
CMD:premiums playerid )
{
     new 
0str[128];
     if ( 
PlayerInfo[playerid][LoggedIn] == ) return SendClientMessageplayerid, -1""RED"ERROR: "GREY"You must be logged in!");
     for (new 
0MAX_PLAYERSi++)
     {
         if (
IsPlayerConnected(i))
         {
             if (
PlayerInfo[i][VIP] >= 1)
             {
                 
c++;
                 if (
c==1)
                 {
                      
format(strsizeof(str), ""REDORANGE"Premium member(s)/donators online:\n{%06x}%s(%d)\n", (GetPlayerColor(i) >>> 8), GetName(i), i);
                    }
                 if (
>=2)
                 {
                      
format(strsizeof(str), "\n%s{%06x}%s(%d)"str, (GetPlayerColor(i) >>> 8), GetName(i), i);
                  }
            }
        }
    }
    if (
== 0) return SendClientMessage(playerid, -1""STEELBLUE"SERVER: There are no donators/premiums online.");
     
ShowPlayerDialog(playeridDIALOG_VIPSDIALOG_STYLE_MSGBOX""RED"Premium/Donators Online:"str"OK""");
     return 
1;

What's the problem?
Reply
#2

PHP код:
CMD:remiums playerid )
{
    new 
0str[128];
    if ( 
PlayerInfo[playerid][LoggedIn] == ) return SendClientMessageplayerid, -1""RED"ERROR: "GREY"You must be logged in!");
    for (new 
0MAX_PLAYERSi++)
    {
        if (
IsPlayerConnected(i))
        {
            if (
PlayerInfo[i][VIP] >= 1)
            {
                
c++;
                if (
c==1)
                {
                    
format(strsizeof(str), ""REDORANGE"Premium member(s)/donators online:\n{%06x}%s(%d)\n", (GetPlayerColor(i) >>> , GetName(i), i);
                }
                else if (
>=2)
                {
                    
format(strsizeof(str), "\n%s{%06x}%s(%d)"str, (GetPlayerColor(i) >>> , GetName(i), i);
                }
            }
        }
    }
    if (
== 0) return SendClientMessage(playerid, -1""STEELBLUE"SERVER: There are no donators/premiums online.");
    
ShowPlayerDialog(playeridDIALOG_VIPSDIALOG_STYLE_MSGBOX""RED"Premium/Donators Online:"str"OK""");
    return 
1;

Reply
#3

Then what do I need to do?
Reply
#4

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

Maybe someone help?
Reply
#6

That's terrible Stuun!
Reply
#7

True.Maybe if I cry, then I will get a good answer.
Reply
#8

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

Can you fix my code and send me it..
I don't see the problem
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)