[Please Help me] 217 Loose Indentation
#1

So there warning is at the line Vehicle_Armor{iVehicleID}; when I am removing it it's fine. Any way to fix it?
pawn Код:
Vehicle_ResetData(iVehicleID) {
    if(GetVehicleModel(iVehicleID)) {
    for(new cv = 0; cv < 6; cv++)
        {
            CrateVehicleLoad[iVehicleID][vCrateID][cv] = -1;
        }
        LockStatus{iVehicleID} = 0;
        VehicleStatus{iVehicleID} = 0;
        arr_Engine{iVehicleID} = 0;
        TruckContents{iVehicleID} = 0;
        Vehicle_Armor(iVehicleID); //Warning is in this line, when I am removing this warning is getting removed.
        VehicleFuel[iVehicleID] = 100.0;

        if(LockStatus{iVehicleID}) foreach(Player, i) if(PlayerInfo[i][pLockCar] == iVehicleID) {
            PlayerInfo[i][pLockCar] = INVALID_VEHICLE_ID;
        }

        if(VehicleBomb{iVehicleID} == 1) foreach(Player, i) if(PlacedVehicleBomb[i] == iVehicleID) {
            VehicleBomb{iVehicleID} = 0;
            PlacedVehicleBomb[i] = INVALID_VEHICLE_ID;
            PickUpC4(i);
            PlayerInfo[i][pC4Used] = 0;
            PlayerInfo[i][pC4Get] = 1;
        }
    }
}
And that's how the Vehicle_Armor is created
pawn Код:
Vehicle_Armor(iVehicleID) {
    switch(GetVehicleModel(iVehicleID)) {
        case 407, 416, 490, 497, 544, 552, 596, 597, 598, 599: SetVehicleHealth(iVehicleID, 2000.0);
        case 447, 470: SetVehicleHealth(iVehicleID, 3000.0);
        case 427, 428, 433, 502, 601, 476, 548, 563: SetVehicleHealth(iVehicleID, 4000.0);
        case 425, 432, 520, 592: SetVehicleHealth(iVehicleID, 6000.0);
    }
}
Reply
#2

Try that.

pawn Код:
Vehicle_ResetData(iVehicleID) {
        if(GetVehicleModel(iVehicleID)) {
            for(new cv = 0; cv < 6; cv++)
            {
                CrateVehicleLoad[iVehicleID][vCrateID][cv] = -1;
            }
            LockStatus{iVehicleID} = 0;
            VehicleStatus{iVehicleID} = 0;
            arr_Engine{iVehicleID} = 0;
            TruckContents{iVehicleID} = 0;
            Vehicle_Armor(iVehicleID); //Warning is in this line, when I am removing this warning is getting removed.
            VehicleFuel[iVehicleID] = 100.0;

        if(LockStatus{iVehicleID}) foreach(Player, i) if(PlayerInfo[i][pLockCar] == iVehicleID) {
            PlayerInfo[i][pLockCar] = INVALID_VEHICLE_ID;
        }

        if(VehicleBomb{iVehicleID} == 1) foreach(Player, i) if(PlacedVehicleBomb[i] == iVehicleID) {
            VehicleBomb{iVehicleID} = 0;
            PlacedVehicleBomb[i] = INVALID_VEHICLE_ID;
            PickUpC4(i);
            PlayerInfo[i][pC4Used] = 0;
            PlayerInfo[i][pC4Get] = 1;
            }
        }
    }
Reply
#3

Well the easiest way to fix this would be adding [pawn]#pragma tabsize 0[pawn] to the top of your code.

But this is a indentation error(as you might have guessed), and it could be easily fixed. Although i don't see the mistake...
Reply
#4

Both of them are right!

But warning doesnt effect ur game ode

I created a server and im getting 37 Warnings!

But my gamemode is working on its top condition

________

+Rep me if i helped u
Reply
#5

Quote:
Originally Posted by TahaScripter123
Посмотреть сообщение
Both of them are right!

But warning doesnt effect ur game ode

I created a server and im getting 37 Warnings!

But my gamemode is working on its top condition

________

+Rep me if i helped u
But i'm pretty sure that bad coding style...
Reply
#6

Quote:
Originally Posted by dusk
Посмотреть сообщение
Well the easiest way to fix this would be adding [pawn]#pragma tabsize 0[pawn] to the top of your code.

But this is a indentation error(as you might have guessed), and it could be easily fixed. Although i don't see the mistake...
I already have it that's why I am posting this thread for some help cause I don't know what to do...
Reply
#7

Quote:
Originally Posted by CesarLT
Посмотреть сообщение
Try that.

pawn Код:
Vehicle_ResetData(iVehicleID) {
        if(GetVehicleModel(iVehicleID)) {
            for(new cv = 0; cv < 6; cv++)
            {
                CrateVehicleLoad[iVehicleID][vCrateID][cv] = -1;
            }
            LockStatus{iVehicleID} = 0;
            VehicleStatus{iVehicleID} = 0;
            arr_Engine{iVehicleID} = 0;
            TruckContents{iVehicleID} = 0;
            Vehicle_Armor(iVehicleID); //Warning is in this line, when I am removing this warning is getting removed.
            VehicleFuel[iVehicleID] = 100.0;

        if(LockStatus{iVehicleID}) foreach(Player, i) if(PlayerInfo[i][pLockCar] == iVehicleID) {
            PlayerInfo[i][pLockCar] = INVALID_VEHICLE_ID;
        }

        if(VehicleBomb{iVehicleID} == 1) foreach(Player, i) if(PlacedVehicleBomb[i] == iVehicleID) {
            VehicleBomb{iVehicleID} = 0;
            PlacedVehicleBomb[i] = INVALID_VEHICLE_ID;
            PickUpC4(i);
            PlayerInfo[i][pC4Used] = 0;
            PlayerInfo[i][pC4Get] = 1;
            }
        }
    }
That's doesn't works

Quote:
Originally Posted by TahaScripter123
Посмотреть сообщение
Both of them are right!

But warning doesnt effect ur game ode

I created a server and im getting 37 Warnings!

But my gamemode is working on its top condition

________

+Rep me if i helped u
I want my gamemode to be perfect, I am slowy learning scripting by fixing all these warnings, I had around 40 warnings and now there is just 1
Reply
#8

Yeee I did it! Thanks for whoever have helped me I will try to give you reputation when I will have 50+ Posts

pawn Код:
Vehicle_ResetData(iVehicleID) {
        if(GetVehicleModel(iVehicleID)) {
        for(new cv = 0; cv < 6; cv++)
        {
                CrateVehicleLoad[iVehicleID][vCrateID][cv] = -1;
        }
        LockStatus{iVehicleID} = 0;
        VehicleStatus{iVehicleID} = 0;
        arr_Engine{iVehicleID} = 0;
        TruckContents{iVehicleID} = 0;

        Vehicle_Armor(iVehicleID);
       
        VehicleFuel[iVehicleID] = 100.0;

        if(LockStatus{iVehicleID}) foreach(Player, i) if(PlayerInfo[i][pLockCar] == iVehicleID) {
            PlayerInfo[i][pLockCar] = INVALID_VEHICLE_ID;
        }

        if(VehicleBomb{iVehicleID} == 1) foreach(Player, i) if(PlacedVehicleBomb[i] == iVehicleID) {
            VehicleBomb{iVehicleID} = 0;
            PlacedVehicleBomb[i] = INVALID_VEHICLE_ID;
            PickUpC4(i);
            PlayerInfo[i][pC4Used] = 0;
            PlayerInfo[i][pC4Get] = 1;
            }
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)