Raised This Month: $ Target: $400
 0% 

sorting by HP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mazmaajinsh
Senior Member
Join Date: Apr 2005
Location: Latvia
Old 05-02-2011 , 17:29   sorting by HP
Reply With Quote #1

Hi guys.
I was wondering, could someone show me an example, how to make this plugin sort players showing in the HUD msg, by HP? I cant understand it at all..

Code:
#include <amxmodx>  
#include <cstrike> 
#include <colorchat>  

#pragma semicolon 1 

public plugin_init()   
{  
    register_plugin("Show info after death", "1.0", "JocA"); 
   
    register_clcmd( "say /showhp", "HPInfo" ); 
}  
public HPInfo( id )  
{  
    new players[32], brojigraca, name[32], player; 

    new ctinfo[500], tinfo[500], ctlen, tlen; 
       
    get_players( players, brojigraca, "ah" ); 
       
    for ( new i = 0; i < brojigraca; i++ )    
    {   
        player = players[i]; 
           
        get_user_name( player, name, 31 );  
         
        new user_health = get_user_health( player ); 
           
        switch ( cs_get_user_team( player ) )   
        {   
            case CS_TEAM_CT: ctlen += formatex( ctinfo[ctlen], charsmax(ctinfo) - ctlen, "%s - %d^n", name, user_health );   
  
            case CS_TEAM_T: tlen += formatex( tinfo[tlen], charsmax(tinfo) - tlen, "%s - %d^n", name, user_health );   
        }   
    }   
    set_hudmessage( 0, 50, 255, 0.06, 0.6, 0, 0.0, 3.1, 0.0, 0.0, -1 ); 
    show_hudmessage( id, ctinfo ); 
    set_hudmessage( 255, 40, 0, 0.7, 0.6, 0, 0.0, 3.1, 0.0, 0.0, -1 ); 
    show_hudmessage( id, tinfo ); 
     
    set_task( 3.0, "HPcInfo", id ); 
     
    return PLUGIN_CONTINUE; 
}
__________________
Ahujena
mazmaajinsh 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 04:26.


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