AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Show enemy HP with hud (https://forums.alliedmods.net/showthread.php?t=142182)

MrDeNNiS26 11-02-2010 11:09

Show enemy HP with hud
 
http://i56.tinypic.com/2j1k9dt.png

Like this, but i want to

Code:

Player Name | Healt: 100
Thanks.

bibu 11-02-2010 17:13

Re: Show enemy HP with hud
 
Show us the code.

Jacob 11-03-2010 00:33

Re: Show enemy HP with hud
 
Quote:

Originally Posted by MrDeNNiS26 (Post 1340143)
http://i56.tinypic.com/2j1k9dt.png

Like this, but i want to

Code:

Player Name | Healt: 100
Thanks.

you mean to aim at a plarer,then show his health?
if so,you can separate the code from miscstats.

nnajko 11-03-2010 18:40

Re: Show enemy HP with hud
 
Try this:
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define IsPlayer(%1) (1 <= %1 <= g_players)

new const PLUGIN_VERSION[]  = "1.0";
new 
gRedgBlue;
new 
g_players;

public 
plugin_init() 
{
 
register_plugin("Aim Health"PLUGIN_VERSION,  "MaNiax");
 
RegisterHam(Ham_Player_PreThink"player""Player_PreThink");
 
g_players get_maxplayers();
}

public 
Player_PreThink(id)
{
 new 
iPlriBody;
 
get_user_aiming(idiPlriBody);
 
 if( 
IsPlayer(iPlr) && is_user_alive(iPlr) )
 {
  switch( 
cs_get_user_team(iPlr) )
  {
   case 
CS_TEAM_T:
   {
    
gRed 255;
    
gBlue 0;
   }
   case 
CS_TEAM_CT:
   {
    
gRed 0;
    
gBlue 255;
   }
  }
  
  new 
EnemyHealth get_user_health(iPlr);
  new 
EnemyName[33];
  
get_user_name(iPlrEnemyNamecharsmax(EnemyName));
  
set_hudmessage(gRedgBlue0, -1.0, -1.006.01.60.10.2, -1); 
  
show_hudmessage(id"Name: %s | Health: %i"EnemyNameEnemyHealth);
 }  



dangername 11-05-2010 22:57

Re: Show enemy HP with hud
 
Quote:

Originally Posted by nnajko (Post 1341438)
Try this:
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#define IsPlayer(%1) (1 <= %1 <= g_players)
new const PLUGIN_VERSION[]  = "1.0";
new 
gRedgBlue;
new 
g_players;
public 
plugin_init() 
{
 
register_plugin("Aim Health"PLUGIN_VERSION,  "MaNiax");
 
RegisterHam(Ham_Player_PreThink"player""Player_PreThink");
 
g_players get_maxplayers();
}
public 
Player_PreThink(id)
{
 new 
iPlriBody;
 
get_user_aiming(idiPlriBody);
 
 if( 
IsPlayer(iPlr) && is_user_alive(iPlr) )
 {
  switch( 
cs_get_user_team(iPlr) )
  {
   case 
CS_TEAM_T:
   {
    
gRed 255;
    
gBlue 0;
   }
   case 
CS_TEAM_CT:
   {
    
gRed 0;
    
gBlue 255;
   }
  }
  
  new 
EnemyHealth get_user_health(iPlr);
  new 
EnemyName[33];
  
get_user_name(iPlrEnemyNamecharsmax(EnemyName));
  
set_hudmessage(gRedgBlue0, -1.0, -1.006.01.60.10.2, -1); 
  
show_hudmessage(id"Name: %s | Health: %i"EnemyNameEnemyHealth);
 }  



Can you do exactly like this , but the message on the center of the screen ?

Exolent[jNr] 11-05-2010 23:31

Re: Show enemy HP with hud
 
Quote:

Originally Posted by dangername (Post 1342912)
Can you do exactly like this , but the message on the center of the screen ?

It already does that.

frwl 06-20-2017 08:37

Re: Show enemy HP with hud
 
Spoiler


Could someone please add #define for admin access only?

Natsheh 06-20-2017 10:05

Re: Show enemy HP with hud
 
Nice bumbing thread 7 years old

HoussamBenmouna 06-20-2017 19:29

Re: Show enemy HP with hud
 
Haha


All times are GMT -4. The time now is 10:40.

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