Raised This Month: $ Target: $400
 0% 

How to get user name and hp show in hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mAr7obg
Senior Member
Join Date: May 2007
Location: Bulgaria
Old 02-11-2010 , 03:02   How to get user name and hp show in hud
Reply With Quote #1

i want get user name and hp and show it with hud
PHP Code:
#include < amxmodx >
#include < fakemeta >

#define VERSION "1.3"

new g_iGlow 33 ]

public 
plugin_init ( )
{
    
register_plugin "TargetGlow"VERSION"Radiance" )
    
register_forward FM_TraceLine"ForwardTraceLinePost")
    
register_forward FM_AddToFullPack"ForwardAddToFullPackPost")
}

public 
ForwardTraceLinePost Float:fStart], Float:fEnd], iConditionsidiTrace )
    if ( 
is_user_alive id ) )
    {
        new 
iClient get_tr2 iTraceTR_pHit )

        if ( 
is_user_alive iClient ) )
            
g_iGlow id ] = iClient
        
else
            
g_iGlow id ] = -1
    
}

public 
ForwardAddToFullPackPost es_handleeenthosthostflagsplayerpSet )
{
    if ( !
player || !is_user_alive host ) || ( g_iGlow host ] != ent ) )
        return 
FMRES_IGNORED

    set_es 
es_handleES_RenderFxkRenderFxGlowShell )

    switch ( 
get_user_teament ) )
    {
        case 
1:
            
set_es es_handleES_RenderColor, { 2000} )
            
//get_user_name, hp
        
case 2:
            
set_es es_handleES_RenderColor, { 00200 } )
                                  
//get_user_name, hp
        
default:
            
set_es es_handleES_RenderColor, { 200200200 } )
    }

    return 
FMRES_IGNORED


Last edited by mAr7obg; 02-11-2010 at 04:00.
mAr7obg is offline
Send a message via Skype™ to mAr7obg
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-11-2010 , 04:22   Re: How to get user name and hp show in hud
Reply With Quote #2

Your user name or target user name?
The code you have posted has nothing to do with your request -.-
__________________
Impossible is Nothing
Sylwester is offline
mAr7obg
Senior Member
Join Date: May 2007
Location: Bulgaria
Old 02-11-2010 , 08:51   Re: How to get user name and hp show in hud
Reply With Quote #3

hey thanks .
mAr7obg is offline
Send a message via Skype™ to mAr7obg
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 02-11-2010 , 15:33   Re: How to get user name and hp show in hud
Reply With Quote #4

Quote:
Originally Posted by Sylwester View Post
Your user name or target user name?
The code you have posted has nothing to do with your request -.-
I think he ment he wants to change that code to show the name and hp
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-11-2010 , 15:44   Re: How to get user name and hp show in hud
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <engine>

new const VERSION[] = "0.0.3"

const MAX_ID_RANGE 2048 // distance maxi a laquelle un joueur peut etre pour que le nom/model s'affiche
const Float:AIM_UPDATE_FREQ 0.2 // fréquence de mise à jour de la visée

const MAX_PLAYERS 32

#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )
new g_iMaxPlayers

new Float:g_flNextSBarUpdateTime[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin("Show Aimed Player Hp"VERSION"ConnorMcLeod")

    
g_iMaxPlayers get_maxplayers()
}

public 
client_PreThinkid )
{
    if( 
is_user_alive(id) )
    {
        static 
Float:flGameTime
        flGameTime 
get_gametime()
        if ( 
g_flNextSBarUpdateTime[id] < flGameTime )
        {
            
            static 
iPlayerosef
            get_user_aiming
(idiPlayerosefMAX_ID_RANGE)
            if( 
IsPlayeriPlayer ) )
            {
                static 
szName[32]
                
get_user_name(iPlayerszNamecharsmax(szName))
                
set_hudmessage(200,100,0, -1.00.3503.03.03.03.0, -1)
                
show_hudmessage(id"%s %d"szNameget_user_health(iPlayer))
            }
            
g_flNextSBarUpdateTime[id] = flGameTime AIM_UPDATE_FREQ
        
}
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
mAr7obg
Senior Member
Join Date: May 2007
Location: Bulgaria
Old 02-11-2010 , 16:37   Re: How to get user name and hp show in hud
Reply With Quote #6

Thanks @ConnorMcLeod
mAr7obg is offline
Send a message via Skype™ to mAr7obg
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-11-2010 , 16:39   Re: How to get user name and hp show in hud
Reply With Quote #7

http://forums.alliedmods.net/showthread.php?t=115266
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 01:09.


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