Raised This Month: $ Target: $400
 0% 

loose indentation


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 07:32.


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