Raised This Month: $ Target: $400
 0% 

Lose identation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-13-2012 , 11:17   Lose identation
Reply With Quote #1

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;


Last edited by GhostMan; 07-13-2012 at 11:25.
GhostMan is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-13-2012 , 12:09   Re: Lose identation
Reply With Quote #2

You can ignore them if you want.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-13-2012 , 13:12   Re: Lose identation
Reply With Quote #3

no, i dont want
GhostMan is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-13-2012 , 13:17   Re: Lose identation
Reply With Quote #4

Then search the forum, this has been asked and answered many times.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-13-2012 , 13:19   Re: Lose identation
Reply With Quote #5

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.
__________________
<VeCo> is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-13-2012 , 13:21   Re: Lose identation
Reply With Quote #6

#pragma tabsize 0 fixes lose indentation if you have mixed tabs and spaces.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-13-2012 , 15:43   Re: Lose identation
Reply With Quote #7

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

Last edited by GhostMan; 07-13-2012 at 15:44.
GhostMan is offline
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-13-2012 , 16:06   Re: Lose identation
Reply With Quote #8

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;

GhostMan is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-13-2012 , 19:44   Re: Lose identation
Reply With Quote #9

Quote:
Originally Posted by <VeCo> View Post
Attach the .sma so we can see it more clearly.
__________________
fysiks is offline
GhostMan
Senior Member
Join Date: Jun 2012
Old 07-14-2012 , 04:41   Re: Lose identation
Reply With Quote #10

Actually this one helped
PHP Code:
#pragma tabsize 0 
GhostMan is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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