Loose Indentation
#1

This is a Error on compiling the gamemode
C:\Users\Home\Desktop\gm nou\ExpertGame (1).pwn(24453) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

This is a lign with the error:
24453 if((IsACBUGWeapon(playerid) && RELEASED(KEY_FIRE)) && newkeys != KEY_FIRE && newkeys & KEY_CROUCH)

Help me Fast please, i want to start my server.

I tried to do it with "http://samp-indent.eu.pn/" but it did not work.
Reply
#2

warning 217 loose indentation


Incorrect indentation:
PHP код:
public OnFilterScriptInit(){
    
    
printf("bla bla 1");
printf("bla bla 2"); //warning 217: loose indentation
    
return 1//warning 217: loose indentation

Correct indentation:
PHP код:
public OnFilterScriptInit(){
    
    
printf("bla bla 1");
    
printf("bla bla 2");
    return 
1;

Reply
#3

Here is a problem ?

if((IsACBUGWeapon(playerid) && RELEASED(KEY_FIRE)) && newkeys != KEY_FIRE && newkeys & KEY_CROUCH)
{
ApplyAnimation ( playerid , "PED" , "getup" , 4.1 , 0 , 0 , 0 , 0 , 0 ) ;
SCM(playerid,COLOR_WHITE,"{AA3333}Pe serverul nostru este interzis c-bug, risti ban 3 zile.");
}
if ((newkeys==KEY_CTRL_BACK )&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerSta te(playerid)==PLAYER_STATE_DRIVER))
{
ShowPlayerDialog(playerid, Dialog_radio, DIALOG_STYLE_LIST, "Car music:","{ff0000}Turn OFF\n{ffffff}Pro FM\nRadio Bandit\nRadio Taraf\nRadio ZU[Audio Plugin]\nKiss FM[Audio Plugin]\nRadio Hot Style\nRadio Gangsta Dance\nRadio Gangsta Manele\nRadio Romanian Hip-Hop\nRadio Romanian Manele\nRadio Romanian Popular\nRadio GMusic Rock\nEuropa FM\nRadio Always\nDubstep FM\nTrap FM\n Radio Tequila","Ok","Cancel");
}
if (newkeys & KEY_NO)
{
if(SwitchKey[playerid] == 1)
{
new string[128];
for(new v; v < PlayerInfo[playerid][pCarSlots]; v++)
{
if(CheckPlayerDistanceToVehicle(5.0, playerid, PlayerInfo[playerid][pCarID][v]))
{
if(PlayerInfo[playerid][pCarLock][v] == 1)
{
GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,0,bonnet,boot,objective);
format(string, sizeof(string), "~h~%s~n~~g~Unlocked",aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
GameTextForPlayer(playerid, string, 5000, 3);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pCarLock][v] = 0;
gCarLock[PlayerInfo[playerid][pCarID][v]] = 0;
cUpdate(playerid, v, cLockx);
return 1;
}
else
{
GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,1,bonnet,boot,objective);
SetVehicleParamsForPlayer(PlayerInfo[playerid][pCarID][v],playerid,0,0);
format(string, sizeof(string), "~h~%s~n~~r~Locked",aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
GameTextForPlayer(playerid, string, 5000, 3);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pCarLock][v] = 1;
gCarLock[PlayerInfo[playerid][pCarID][v]] = 1;
cUpdate(playerid, v, cLockx);
return 1;
}
}
}
return 1;
}
else if(SwitchKey[playerid] == 2)
{
new carid,string[128];
if(HireCar[playerid] == -1) return 1;
if(HireCar[playerid] != -1)
{
carid = HireCar[playerid];
}
if(CheckPlayerDistanceToVehicle(5.0, playerid, HireCar[playerid]))
{
if(gCarLock[carid] == 0)
{
new vehicles = GetVehicleModel(carid) - 400;
format(string, sizeof(string), "~h~%s~n~~r~Locked", aVehicleNames[vehicles]);
GameTextForPlayer(playerid, string, 4000, 4);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 1;
GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
return 1;
}
else if(gCarLock[carid] == 1)
{
new vehicles = GetVehicleModel(carid) - 400;
format(string, sizeof(string), "~h~%s~n~~g~Unlocked", aVehicleNames[vehicles]);
GameTextForPlayer(playerid, string, 4000, 4);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
gCarLock[carid] = 0;
GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
return 1;
}
}
}
}
if (newkeys & KEY_HANDBRAKE)
{
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK && PlayerInfo[playerid][pAdmin] < 1)
{
new string[256];
format(string, sizeof(string), "(N) %s (%d, level %d) created a jetpack.",GetName(playerid),playerid,PlayerInfo[playerid][pLevel]);
ABroadCast(COLOR_RED,string,1);
}
}
if (newkeys & KEY_CROUCH)
{
if(PlayerToPoint(10.0, playerid,907.50238, -1666.58813, 13.50640))
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
{
MoveObject(gatehqa, 907.46240, -1666.58813, 13.40640, 2, -0.04000, -2.32000, -90.00000);
//MoveObject(gatehqa,1596.7352,-1637.9025, 15.0358, 2 , 0.00000, 0.00000, -90.84000);
SetTimer("gateadminclose" ,5000 ,false);
}
}
if(IsACop(playerid))
{

}
if(IsACop(playerid))
{
if(PlayerToPoint(15.0, playerid,1588.6552, -1637.9025, 15.035)
{
MoveObject(gatelspd,1592.65674, -1638.05286, 9.89110,2, -1000.0, -1000.0, -1000.0);
SetTimer("lspdgateclose" ,9000 ,false);
return 1;
}
if(PlayerToPoint(15.0, playerid,2334.8999000, 2444.3999000, 8.3000000))
{
MoveDynamicObject(gatelvpd,2339.3000000, 2450.5000000, 8.3000000,2, -1000.0, -1000.0, -1000.0);
SetTimer("lvpdgateclose" ,9000 ,false);
return 1;
}
if(PlayerToPoint(15.0, playerid,2295.3000000, 2507.0000000, 5.7000000))
{
MoveDynamicObject(gatelvpd2,2295.3000000, 2507.0000000, 5.7000000,2, -1000.0, -1000.0, -1000.0);
SetTimer("lvpdgateclose2" ,9000 ,false);
return 1;
}
if(PlayerToPoint(15.0, playerid,135.2833, 1941.3331, 21.6932))
{
MoveDynamicObject(gateng,122.0023, 1941.4100, 21.6932,2, -1000.0, -1000.0, -1000.0);
SetTimer("nggateclose" ,9000 ,false);
return 1;
}
if(PlayerToPoint(15.0, playerid,1544.7007, -1630.7527, 13.2983))
{
MoveDynamicObject(lspdbar,1544.7007, -1630.7527, 13.2983,1,0.0000, 0.0000, 90.0000);
SetTimer("lspdbarclose" ,9000 ,false);
return 1;
}
if(PlayerToPoint(15.0, playerid,2238.22021, 2450.44312, 10.58781))
{
MoveDynamicObject(lvpdbar,2238.22021, 2450.44312, 10.58781,1,0.0000, 0.0000, 90.0000);
SetTimer("lvpdbarclose" ,9000 ,false);
return 1;
}
}
if(PlayerInfo[playerid][pPhousekey] == 102 || PlayerInfo[playerid][pPhousekey] == 199 || PlayerInfo[playerid][pPhousekey] == 198 || PlayerInfo[playerid][pPhousekey] == 197)
{
if(PlayerToPoint(15.0, playerid,-55.95193, -2111.29956, 3.48741))
{
MoveObject(palatbar1, -55.95193, -2111.29956, 3.48741, 1, 0.0000, 0.00000, 90.0000);
SetTimer("palatbar1close" ,9000 ,false);
return 1;
}
}
}
if (((newkeys & KEY_WALK && newkeys & KEY_UP) || (newkeys & KEY_WALK && newkeys & KEY_DOWN) || (newkeys & KEY_WALK && newkeys & KEY_LEFT) || (newkeys & KEY_WALK && newkeys & KEY_RIGHT))
|| ((oldkeys & KEY_WALK && newkeys & KEY_UP) || (oldkeys & KEY_WALK && newkeys & KEY_DOWN) || (oldkeys & KEY_WALK && newkeys & KEY_LEFT) || (oldkeys & KEY_WALK && newkeys & KEY_RIGHT))
|| ((newkeys & KEY_WALK && oldkeys & KEY_UP) || (newkeys & KEY_WALK && oldkeys & KEY_DOWN) || (newkeys & KEY_WALK && oldkeys & KEY_LEFT) || (newkeys & KEY_WALK && oldkeys & KEY_RIGHT))
&& GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
}
Reply
#4

Find the line 24453 in your script and align it with other lines (up and down). You can run script without fixing this warning because it won't affect anything.
Reply
#5

Quote:
Originally Posted by Saddin
Посмотреть сообщение
You can run script without fixing this warning because it won't affect anything.
That doesn't mean you should! That's bad advice and bad practice in general.
Reply
#6

Quote:
Originally Posted by Burridge
Посмотреть сообщение
That doesn't mean you should! That's bad advice and bad practice in general.
I know and I agree, I always fix if I come to this warning. I'm just saying if I'm doing some quick testing I don't have to fix that immediately, I can do it later. Of course I fix warning later when players have to play on it.
Reply
#7

By ignoring the warning and continuing to script, you'll find after a while that a warning, causes a bug, which won't show up as easily as if you'd actually paid attention to the warning.
Reply
#8

Try this one:

PHP код:
if((IsACBUGWeapon(playerid) && RELEASED(KEY_FIRE)) && newkeys != KEY_FIRE && newkeys KEY_CROUCH)
{
    
ApplyAnimation playerid "PED" "getup" 4.1 ) ;
    
SCM(playerid,COLOR_WHITE,"{AA3333}Pe serverul nostru este interzis c-bug, risti ban 3 zile.");
}
if ((
newkeys==KEY_CTRL_BACK )&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerSta te(playerid)==PLAYER_STATE_DRIVER))
{
    
ShowPlayerDialog(playeridDialog_radioDIALOG_STYLE_LIST"Car music:","{ff0000}Turn OFF\n{ffffff}Pro FM\nRadio Bandit\nRadio Taraf\nRadio ZU[Audio Plugin]\nKiss FM[Audio Plugin]\nRadio Hot Style\nRadio Gangsta Dance\nRadio Gangsta Manele\nRadio Romanian Hip-Hop\nRadio Romanian Manele\nRadio Romanian Popular\nRadio GMusic Rock\nEuropa FM\nRadio Always\nDubstep FM\nTrap FM\n Radio Tequila","Ok","Cancel");
}
if (
newkeys KEY_NO)
{
    if(
SwitchKey[playerid] == 1)
    {
        new 
string[128];
        for(new 
vPlayerInfo[playerid][pCarSlots]; v++)
        {
            if(
CheckPlayerDistanceToVehicle(5.0playeridPlayerInfo[playerid][pCarID][v]))
            {
                if(
PlayerInfo[playerid][pCarLock][v] == 1)
                {
                    
GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,0,bonnet,boot,objective);
                    
format(stringsizeof(string), "~h~%s~n~~g~Unlocked",aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
                    
GameTextForPlayer(playeridstring50003);
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
PlayerInfo[playerid][pCarLock][v] = 0;
                    
gCarLock[PlayerInfo[playerid][pCarID][v]] = 0;
                    
cUpdate(playeridvcLockx);
                    return 
1;
                }
                else
                {
                    
GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
                    
SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,1,bonnet,boot,objective);
                    
SetVehicleParamsForPlayer(PlayerInfo[playerid][pCarID][v],playerid,0,0);
                    
format(stringsizeof(string), "~h~%s~n~~r~Locked",aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
                    
GameTextForPlayer(playeridstring50003);
                    
PlayerPlaySound(playerid11450.00.00.0);
                    
PlayerInfo[playerid][pCarLock][v] = 1;
                    
gCarLock[PlayerInfo[playerid][pCarID][v]] = 1;
                    
cUpdate(playeridvcLockx);
                    return 
1;
                }
            }
        }
        return 
1;
    }
    else if(
SwitchKey[playerid] == 2)
    {
        new 
carid,string[128];
        if(
HireCar[playerid] == -1) return 1;
        if(
HireCar[playerid] != -1)
        {
            
carid HireCar[playerid];
        }
        if(
CheckPlayerDistanceToVehicle(5.0playeridHireCar[playerid]))
        {
            if(
gCarLock[carid] == 0)
            {
                new 
vehicles GetVehicleModel(carid) - 400;
                
format(stringsizeof(string), "~h~%s~n~~r~Locked"aVehicleNames[vehicles]);
                
GameTextForPlayer(playeridstring40004);
                
PlayerPlaySound(playerid11450.00.00.0);
                
gCarLock[carid] = 1;
                
GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                
SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
                return 
1;
            }
            else if(
gCarLock[carid] == 1)
            {
                new 
vehicles GetVehicleModel(carid) - 400;
                
format(stringsizeof(string), "~h~%s~n~~g~Unlocked"aVehicleNames[vehicles]);
                
GameTextForPlayer(playeridstring40004);
                
PlayerPlaySound(playerid11450.00.00.0);
                
gCarLock[carid] = 0;
                
GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
                
SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
                return 
1;
            }
        }
    }
}
if (
newkeys KEY_HANDBRAKE)
{
    if(
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK && PlayerInfo[playerid][pAdmin] < 1)
    {
        new 
string[256];
        
format(stringsizeof(string), "(N) %s (%d, level %d) created a jetpack.",GetName(playerid),playerid,PlayerInfo[playerid][pLevel]);
        
ABroadCast(COLOR_RED,string,1);
    }
}
if (
newkeys KEY_CROUCH)
{
    if(
PlayerToPoint(10.0playerid,907.50238, -1666.5881313.50640))
    {
        if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pHelper] >= 1)
        {
            
MoveObject(gatehqa907.46240, -1666.5881313.406402, -0.04000, -2.32000, -90.00000);
            
//MoveObject(gatehqa,1596.7352,-1637.9025, 15.0358, 2 , 0.00000, 0.00000, -90.84000);
            
SetTimer("gateadminclose" ,5000 ,false);
        }
    }
    if(
IsACop(playerid))
    {
        
    }
    if(
IsACop(playerid))
    {
        if(
PlayerToPoint(15.0playerid,1588.6552, -1637.902515.035)
        {
            
MoveObject(gatelspd,1592.65674, -1638.052869.89110,2, -1000.0, -1000.0, -1000.0);
            
SetTimer("lspdgateclose" ,9000 ,false);
            return 
1;
        }
        if(
PlayerToPoint(15.0playerid,2334.89990002444.39990008.3000000))
        {
            
MoveDynamicObject(gatelvpd,2339.30000002450.50000008.3000000,2, -1000.0, -1000.0, -1000.0);
            
SetTimer("lvpdgateclose" ,9000 ,false);
            return 
1;
        }
        if(
PlayerToPoint(15.0playerid,2295.30000002507.00000005.7000000))
        {
            
MoveDynamicObject(gatelvpd2,2295.30000002507.00000005.7000000,2, -1000.0, -1000.0, -1000.0);
            
SetTimer("lvpdgateclose2" ,9000 ,false);
            return 
1;
        }
        if(
PlayerToPoint(15.0playerid,135.28331941.333121.6932))
        {
            
MoveDynamicObject(gateng,122.00231941.410021.6932,2, -1000.0, -1000.0, -1000.0);
            
SetTimer("nggateclose" ,9000 ,false);
            return 
1;
        }
        if(
PlayerToPoint(15.0playerid,1544.7007, -1630.752713.2983))
        {
            
MoveDynamicObject(lspdbar,1544.7007, -1630.752713.2983,1,0.00000.000090.0000);
            
SetTimer("lspdbarclose" ,9000 ,false);
            return 
1;
        }
        if(
PlayerToPoint(15.0playerid,2238.220212450.4431210.58781))
        {
            
MoveDynamicObject(lvpdbar,2238.220212450.4431210.58781,1,0.00000.000090.0000);
            
SetTimer("lvpdbarclose" ,9000 ,false);
            return 
1;
        }
    }
    if(
PlayerInfo[playerid][pPhousekey] == 102 || PlayerInfo[playerid][pPhousekey] == 199 || PlayerInfo[playerid][pPhousekey] == 198 || PlayerInfo[playerid][pPhousekey] == 197)
    {
        if(
PlayerToPoint(15.0playerid,-55.95193, -2111.299563.48741))
        {
            
MoveObject(palatbar1, -55.95193, -2111.299563.4874110.00000.0000090.0000);
            
SetTimer("palatbar1close" ,9000 ,false);
            return 
1;
        }
    }
}
if (((
newkeys KEY_WALK && newkeys KEY_UP) || (newkeys KEY_WALK && newkeys KEY_DOWN) || (newkeys KEY_WALK && newkeys KEY_LEFT) || (newkeys KEY_WALK && newkeys KEY_RIGHT))
    || ((
oldkeys KEY_WALK && newkeys KEY_UP) || (oldkeys KEY_WALK && newkeys KEY_DOWN) || (oldkeys KEY_WALK && newkeys KEY_LEFT) || (oldkeys KEY_WALK && newkeys KEY_RIGHT))
|| ((
newkeys KEY_WALK && oldkeys KEY_UP) || (newkeys KEY_WALK && oldkeys KEY_DOWN) || (newkeys KEY_WALK && oldkeys KEY_LEFT) || (newkeys KEY_WALK && oldkeys KEY_RIGHT))
&& 
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
    
walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);

i suggest to you to use Indenter to avoid loose indentation warnings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)