Warning 217: Loose indentation :S
#1

C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(53594) : warning 217: loose indentation
C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(53601) : warning 217: loose indentation
C:\Users\Frede\Desktop\Server\Raven's Roleplay 0.3c\gamemodes\larp.pwn(53605) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Warnings.


Here's the pastebin http://bb3dev.pastebin.com/ZiYNTKKB
Reply
#2

pawn Код:
if(strcmp(cmd, "/flip", true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:PX, Float:PY, Float:PZ, Float:PA;
            GetPlayerPos(playerid, PX, PY, PZ); // Im getting warning on THIS line
            GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SendClientMessage(playerid, COLOR_GREEN," Vehicle Succesfully Flipped!");
        }
    }
    else return SendClientMessage(playerid, COLOR_GRAD1, " You Are Not An Admin Level 3!");
    return 1; // And this..
}
Reply
#3

Simple, just check the indentation of your code.
Reply
#4

Put this under inc's:
pawn Код:
#pragma tabsize 0
Reply
#5

@xRyder thanks it worked.

@Clive I do that now.
Reply
#6

Quote:
Originally Posted by Clive
Посмотреть сообщение
Put this under inc's:
pawn Код:
#pragma tabsize 0
That's not fixing the problem, it's merely hiding it. Although if you don't want to indent code that's fine, but it only makes it harder for you to read the code and a lot harder to find problems with your code.

xRyder's code is how the code should be indented, it makes it a lot easier to read and understand.
Reply
#7

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
That's not fixing the problem, it's merely hiding it. Although if you don't want to indent code that's fine, but it only makes it harder for you to read the code and a lot harder to find problems with your code.

xRyder's code is how the code should be indented, it makes it a lot easier to read and understand.
Okay sir
Reply
#8

Yes, this is what indentation is:


BAD indentation
pawn Код:
CMD:random( playerid, params[ ] )
{
 SendClientMessage( playerid, 0xAAAAA, "Abcd" );
    SendClientMessage(playerid, 0xAAAAAA, "Very bad indentation" );
return 1;
}
GOOD indentation:
pawn Код:
CMD:random( playerid, params[ ] )
{
    SendClientMessage( playerid, 0xAAAAA, "Abcd" );
    SendClientMessage( playerid, 0xAAAAAA, "Very good indentation" );
    return 1;
}
You should now understand why you get that warning.
Since no one explained why this warning is appearing. If your code is not in the right order (not placed rightly) it will give you warnings.
#pragma tabsize 0 can fak the script, I recommend not using it.
Deufault tabsize of SA-MP is 4, and you should respect it!
It's always best to show it with examples, then people understand it .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)