Raised This Month: $51 Target: $400
 12% 

loose indentation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 11-18-2018 , 11:41   loose indentation
Reply With Quote #1

PHP Code:
public msgHealth(msgiddestid)
{
if(!
g_isAlive[id])
    return 
PLUGIN_CONTINUE;
    static 
hp;
    
hp get_msg_arg_int(1);
    if(
hp 255 && (hp 256) == 0)
        
set_msg_arg_int(1ARG_BYTE, ++hp);
    
    return 
PLUGIN_CONTINUE;

loose indentation error on line
Code:
	static hp;
and

PHP Code:
static player
for (player 1player <= g_iMaxPlayersplayer++)
{
    
// Not connected
    
if (!g_isConnected[player])
        continue;
        
// Remember changed arguments
        
static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
        
changedcount 0
        
// Replace LANG_PLAYER with player id
        
for (2argscounti++)
        {
            if (
getarg(i) == LANG_PLAYER)
            {
                
setarg(i0player)
                
changed[changedcount] = i
                changedcount
++
            }
        }
        
        
// Format message for player
        
vformat(buffercharsmax(buffer), message3)
        
        
// Send it
        
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
        
write_byte(player)
        
write_string(buffer)
        
message_end()
        
        
// Replace back player id's with LANG_PLAYER
        
for (0changedcounti++)
            
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    
// Send to specific target
    
else
    {
        
// Format message for player
        
vformat(buffercharsmax(buffer), message3)
        
        
// Send it
        
message_begin(MSG_ONEg_msgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }

loose indentation error on line :
Code:
	static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
I am wondering why do i get that? i haven't left any space and i've used amxmodx indenter. any help?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 11-18-2018 , 12:25   Re: loose indentation
Reply With Quote #2

You simply have bad indentation.

PHP Code:
public msgHealth(msgiddestid

    if(!
g_isAlive[id]) 
        return 
PLUGIN_CONTINUE

    static 
hp
    
hp get_msg_arg_int(1);
     
    if(
hp 255 && (hp 256) == 0
        
set_msg_arg_int(1ARG_BYTE, ++hp); 
     
    return 
PLUGIN_CONTINUE

This code bit isn't correct actually:

PHP Code:
static player 
for (player 1player <= g_iMaxPlayersplayer++) 

    
// Not connected 
    
if (!g_isConnected[player]) 
        continue;

    
// Remember changed arguments 
    
static changed[5], changedcount // [5] = max LANG_PLAYER occurencies 
    
changedcount 
    
// Replace LANG_PLAYER with player id 
    
for (2argscounti++) 
    { 
        if (
getarg(i) == LANG_PLAYER
        { 
            
setarg(i0player
            
changed[changedcount] = 
            changedcount
++ 
        } 
    } 
         
    
// Format message for player 
    
vformat(buffercharsmax(buffer), message3
         
    
// Send it 
    
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player
    
write_byte(player
    
write_string(buffer
    
message_end() 
         
    
// Replace back player id's with LANG_PLAYER 
    
for (0changedcounti++) {
        
setarg(changed[i], 0LANG_PLAYER
    }
    
    
// Send to specific target 
    
else 
    {
        
// Format message for player 
        
vformat(buffercharsmax(buffer), message3
         
        
// Send it 
        
message_begin(MSG_ONEg_msgSayText_target
        
write_byte(target
        
write_string(buffer
        
message_end() 
    } 

__________________

Last edited by Airkish; 11-18-2018 at 12:30.
Airkish is offline
Old 11-19-2018, 13:15
devilsquare
This message has been deleted by devilsquare.
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:03.


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