AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Lose identation (https://forums.alliedmods.net/showthread.php?t=189979)

GhostMan 07-13-2012 11:17

Lose identation
 
PHP Code:

public fw_player_killed(victimattackershouldgib)
{

    if(!
is_user_connected(victim) || !is_user_connected(attacker) || attacker == victim || get_playersnum() < 4)
    return 
HAM_IGNORED;

    new 
bool:killvip[32], bool:killct[32], bool:killviphs[32], bool:killhs[32];
        
    if(
get_user_team(attacker) == 1)
    {
        if(
get_user_flags(attacker) & ADMIN_LEVEL_H)
        {
            
g_jbpacks[attacker] += get_pcvar_num(g_killjp) * 2;
            
killvip[attacker] = true;
        }
        else
        {
            
g_jbpacks[attacker] += get_pcvar_num(g_killjp);
            
killct[attacker] = true;
        }
        
        if(
get_pdata_int(victim75) == HIT_HEAD)
        {
            if(
get_user_flags(attacker) & ADMIN_LEVEL_H)
            {
                
g_jbpacks[attacker] += get_pcvar_num(g_killhsjp) * 2;
                
killviphs[attacker] = true;
            }
            else
            {
                
g_jbpacks[attacker] += get_pcvar_num(g_killhsjp);
                
killhs[attacker] = true;
            }
        }
        
        if(
killviphs[attacker]) {
            
ChatColor(attacker"!g[Shop] !yTu gavai !team%d NP !yuz  nuzudyta CT + !team%d NP!y, nes padariai tai su HS.",  get_pcvar_num(g_killjp) * 2get_pcvar_num(g_killhsjp) * 2);
            
killviphs[attacker] = false;
        }
        else if(
killhs[attacker]) {
            
ChatColor(attacker"!g[Shop] !yTu gavai !team%d NP !yuz  nuzudyta CT + !team%d NP!y, nes padariai tai su HS.",  get_pcvar_num(g_killjp), get_pcvar_num(g_killhsjp));
            
killhs[attacker] = false;
        }
        else if(!(
killviphs[attacker]) && killvip[attacker]) {
            
ChatColor(attacker"!g[Shop] !yTu gavai !team%d NP !yuz nuzudyta CT."get_pcvar_num(g_killjp) * 2)
            
killvip[attacker] = false;
        }
        else if(!(
killhs[attacker]) && killct[attacker]) {
            
ChatColor(attacker"!g[Shop] !yTu gavai !team%d NP !yuz nuzudyta CT."get_pcvar_num(g_killjp));
            
killct[attacker] = false;
        }
    }
    return 
HAM_IGNORED;


http://i.minus.com/igLqZtvp4aZAB.png

wickedd 07-13-2012 12:09

Re: Lose identation
 
You can ignore them if you want.

GhostMan 07-13-2012 13:12

Re: Lose identation
 
no, i dont want

wickedd 07-13-2012 13:17

Re: Lose identation
 
Then search the forum, this has been asked and answered many times.

<VeCo> 07-13-2012 13:19

Re: Lose identation
 
We can hardly help you with directly copy/pasted code in the forum.
The warning comes, because the code isn't indented properly. Attach the .sma so we can see it more clearly or you can add:
PHP Code:

#pragma tabsize 0 

And they will disappear.

ConnorMcLeod 07-13-2012 13:21

Re: Lose identation
 
#pragma tabsize 0 fixes lose indentation if you have mixed tabs and spaces.

GhostMan 07-13-2012 15:43

Re: Lose identation
 
But if i delete all those variables from this function

PHP Code:

new bool:killvip[32], bool:killct[32], bool:killviphs[32], bool:killhs[32



All those "identation lose" warnings dissapears

GhostMan 07-13-2012 16:06

Re: Lose identation
 
What i'm trying to say, if i compile plugin with this code

PHP Code:

public fw_player_killed(victimattackershouldgib)
{
    if(!
is_user_connected(victim) || !is_user_connected(attacker) || attacker == victim || get_playersnum() < 4)
        return 
HAM_IGNORED;
        
    if(
get_user_team(attacker) == 1)
    {
        if(
get_user_flags(attacker) & ADMIN_LEVEL_H)
        {
            
g_jbpacks[attacker] += get_pcvar_num(g_killjp) * 2;
        }
        else
        {
            
g_jbpacks[attacker] += get_pcvar_num(g_killjp);
        }
        
        if(
get_pdata_int(victim75) == HIT_HEAD)
        {
            if(
get_user_flags(attacker) & ADMIN_LEVEL_H)
            {
                
g_jbpacks[attacker] += get_pcvar_num(g_killhsjp) * 2;
            }
            else
            {
                
g_jbpacks[attacker] += get_pcvar_num(g_killhsjp);
            }
        }
    }
    return 
HAM_IGNORED;


everything is fine, i dont get any warning. But if i use this code, then i got "identation lose" warning when compiling

PHP Code:

public fw_player_killed(victimattackershouldgib)
{
    if(!
is_user_connected(victim) || !is_user_connected(attacker) || attacker == victim || get_playersnum() < 4)
        return 
HAM_IGNORED;

    new 
bool:killvip[32], bool:killct[32], bool:killviphs[32], bool:killhs[32];
        
    if(
get_user_team(attacker) == 1)
    {
        if(
get_user_flags(attacker) & ADMIN_LEVEL_H)
        {
            
g_jbpacks[attacker] += get_pcvar_num(g_killjp) * 2;
            
killvip[attacker] = true;
        }
        else
        {
            
g_jbpacks[attacker] += get_pcvar_num(g_killjp);
            
killct[attacker] = true;
        }
        
        if(
get_pdata_int(victim75) == HIT_HEAD)
        {
            if(
get_user_flags(attacker) & ADMIN_LEVEL_H)
            {
                
g_jbpacks[attacker] += get_pcvar_num(g_killhsjp) * 2;
                
killviphs[attacker] = true;
            }
            else
            {
                
g_jbpacks[attacker] += get_pcvar_num(g_killhsjp);
                
killhs[attacker] = true;
            }
        }
        
        if(
killviphs[attacker]) {
            
ChatColor(attacker"!g[NWK Shop] !yTu gavai !team%d NP !yuz nuzudyta CT + !team%d NP!y, nes padariai tai su HS."get_pcvar_num(g_killjp) * 2get_pcvar_num(g_killhsjp) * 2);
            
killviphs[attacker] = false;
        }
        else if(
killhs[attacker]) {
            
ChatColor(attacker"!g[NWK Shop] !yTu gavai !team%d NP !yuz nuzudyta CT + !team%d NP!y, nes padariai tai su HS."get_pcvar_num(g_killjp), get_pcvar_num(g_killhsjp));
            
killhs[attacker] = false;
        }
        else if(!(
killviphs[attacker]) && killvip[attacker]) {
            
ChatColor(attacker"!g[NWK Shop] !yTu gavai !team%d NP !yuz nuzudyta CT."get_pcvar_num(g_killjp) * 2)
            
killvip[attacker] = false;
        }
        else if(!(
killhs[attacker]) && killct[attacker]) {
            
ChatColor(attacker"!g[NWK Shop] !yTu gavai !team%d NP !yuz nuzudyta CT."get_pcvar_num(g_killjp));
            
killct[attacker] = false;
        }
    }
    return 
HAM_IGNORED;



fysiks 07-13-2012 19:44

Re: Lose identation
 
Quote:

Originally Posted by <VeCo> (Post 1749599)
Attach the .sma so we can see it more clearly.


GhostMan 07-14-2012 04:41

Re: Lose identation
 
Actually this one helped
PHP Code:

#pragma tabsize 0 



All times are GMT -4. The time now is 15:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.