Simple Problem,
#1

Here are the warnings/ Errors:
pawn Код:
C:\Users\Lewis Ryan\Desktop\Roleplay Server Backup\gamemodes\sarp.pwn(20740) : warning 217: loose indentation
C:\Users\Lewis Ryan\Desktop\Roleplay Server Backup\gamemodes\sarp.pwn(20763) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
It is just loose indentation, and i guess that means the brackets...

Here is my script:

pawn Код:
if(strcmp(cmd, "/helperon", true) == 0) //Tourist Camera
    {
     for(new i; i < MAX_PLAYERS; i++)
        if(IsPlayerConnected(playerid))
        {
            {
              if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 0);
                    }
    {
                    AttachObjectToPlayer( helper, playerid, 0, 0.0, 1.5, 0, 0, 0 );
                    AttachObjectToPlayer( helperaddon, playerid, 0, 0.0, -1.5, 0, 0, 0 );
                    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
                    Delete3DTextLabel(DutyLabel[playerid]);
                    DutyLabel[playerid] = Create3DTextLabel("Ask Me For Help!",0xFF9900AA,0,0,0,100,-1,1);
                    Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0.25);

                    return 1;
                }
            }
        }
    }
On This Line: 20740:

pawn Код:
{
it is just a bracket, where do i need to put it?

That bracket is on the 11th line in the above script.

Thanks For The Help!
Reply
#2

#pragma tabsize 0 on top of script.
Reply
#3

Quote:
Originally Posted by Gh0sT_
Посмотреть сообщение
#pragma tabsize 0 on top of script.
Gods give me strength.. please..

A loose indentation means your code isn't indented well.

An example of bad indentation:

pawn Код:
if(IsplayerConnected(playerid)
{
             print("Connected");
  new string[128];
          GetPlayerName(playerid, string, sizeof string);
                     format(string, sizeof string, "Hello %s!", string);
}
Well indented:

pawn Код:
if(IsplayerConnected(playerid)
{
         print("Connected");
         new string[128];
         GetPlayerName(playerid, string, sizeof string);
         format(string, sizeof string, "Hello %s!", string);
}
Notice how the code is now on equal horizontal lines? That's well indented. Using #pragma tabsize 0 only increases the problems.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)