SA-MP Forums Archive
Anti Vehicle Crash - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti Vehicle Crash (/showthread.php?tid=420223)



Anti Vehicle Crash - PabloDiCostanzo - 04.03.2013

Greetings,

I have this warning:
Код:
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\filterscripts\AntiCrash.pwn(26) : warning 217: loose indentation
In this line:

pawn Код:
if(!IsComponentidCompatible(GetVehicleModel(vehicleid), componentid)) RemoveVehicleComponent(vehicleid, componentid);
Actually I don`t know what mean "Loose Indentation". If some one can help me with this, please.


Regards,
Pablo.


Re: Anti Vehicle Crash - Azazelo - 04.03.2013

Loose Indentation
pawn Код:
COMMAND;
 Loose Indentation;// Commands not in line
COMMAND;
return 1;



Re: Anti Vehicle Crash - arathin - 04.03.2013

Show me more of your code like from the beginning of the line to the end of the line lets say lines 15-30


Re: Anti Vehicle Crash - PabloDiCostanzo - 04.03.2013

pawn Код:
public OnVehicleMod(playerid, vehicleid, componentid)
{
    switch(componentid)
        {
            case 1008..1010: if(IsPlayerInInvalidNosVehicle(playerid)) RemoveVehicleComponent(vehicleid, componentid);
        }
        if(!IsComponentidCompatible(GetVehicleModel(vehicleid), componentid)) RemoveVehicleComponent(vehicleid, componentid);
        return 1;
}



Re: Anti Vehicle Crash - DerickClark - 04.03.2013

Its out of line. is Dis:
Код:
case 1008..1010: if(IsPlayerInInvalidNosVehicle(playerid)) RemoveVehicleComponent(vehicleid, componentid);[
+
Код:
switch(componentid)



Re: Anti Vehicle Crash - PabloDiCostanzo - 04.03.2013

More errors, if I use that

EDIT: I just need to know what is "Loose Indenation" and how to take off this warn


Re: Anti Vehicle Crash - MP2 - 04.03.2013

Align them. Use TAB or shift+TAB to ident.


Re: Anti Vehicle Crash - DerickClark - 04.03.2013

like dis:

Код:
CMD:test(playerid, params[])
{
    SendClientMessage(playerid, 0xFF0000AA, "Testing0");
    SendClientMessage(playerid, 0xFF0000AA, "Testing1");
    SendClientMessage(playerid, 0xFF0000AA, "Testing2");
     SendClientMessage(playerid, 0xFF0000AA, "Testing3");
	return 1;
}
SendClientMessage(playerid, 0xFF0000AA, "Testing3"); out of line
That's loose indentation


Re: Anti Vehicle Crash - PabloDiCostanzo - 04.03.2013

Still having this warning:

Код:
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\filterscripts\AntiCrash.pwn(26) : warning 217: loose indentation
----------------------0----------------------------------

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
like dis:

Код:
CMD:test(playerid, params[])
{
    SendClientMessage(playerid, 0xFF0000AA, "Testing0");
    SendClientMessage(playerid, 0xFF0000AA, "Testing1");
    SendClientMessage(playerid, 0xFF0000AA, "Testing2");
     SendClientMessage(playerid, 0xFF0000AA, "Testing3");
	return 1;
}
SendClientMessage(playerid, 0xFF0000AA, "Testing3"); out of line
That's loose indentation
This isn`t a command. THIS IS WHAT I WANT


Re: Anti Vehicle Crash - MP2 - 04.03.2013

pawn Код:
public OnVehicleMod(playerid, vehicleid, componentid)
{
    switch(componentid)
        {
            case 1008..1010: if(IsPlayerInInvalidNosVehicle(playerid)) RemoveVehicleComponent(vehicleid, componentid);
        }
        if(!IsComponentidCompatible(GetVehicleModel(vehicleid), componentid)) RemoveVehicleComponent(vehicleid, componentid);
        return 1;
}
Look at the alignment.

Now look again:

pawn Код:
public OnVehicleMod(playerid, vehicleid, componentid)
{
    switch(componentid)
    {
        case 1008..1010: if(IsPlayerInInvalidNosVehicle(playerid)) RemoveVehicleComponent(vehicleid, componentid);
    }
    if(!IsComponentidCompatible(GetVehicleModel(vehicleid), componentid)) RemoveVehicleComponent(vehicleid, componentid);
    return 1;
}
Code between the two braces should be indented at the same level.