Results 1 to 8 of 8

Thread: [Call Of Duty 2] Other players his HP bar

  1. #1
    ... connecting
    Join Date
    Apr 2014
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question [Call Of Duty 2] Other players his HP bar

    Hello,

    Does anyone have an example of an HP bar (The HP bar of an other player like level.killer = self.health and then level.killer as the value of the HP bar or something)


    Thanksss,

    Anonymuis.

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Its already in cod2. You only need to enable it in the menu file

  3. #3
    ... connecting
    Join Date
    Apr 2014
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I want to create my own HP bar with an HUDelem

  4. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    You should hook into callback_playerdamage and _healthoverlay.gsc for that then. Also, read some hud elem tutorials
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. #5
    ... connecting
    Join Date
    Apr 2014
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are those tutorials on this website?

  6. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Anonymuis View Post
    I want to create my own HP bar with an HUDelem
    Why would you want to waste a hud element on something which is already available through the game itself, and which does a better job than any hud element could ever do (the stock health bar pulses when your health is not at max - you can't do that in a hud element)?

    To enable the stock health bar you need to do the following:

    1. You need to turn health regeneration off;

    2. You need to turn on certain cvars on the client in onPlayerSpawned():

    Code:
    	self setClientCvar( "cg_drawhealth", "1" );
    	self setClientCvar( "hud_fade_healthbar", "0" );

  7. #7
    ... connecting
    Join Date
    Apr 2014
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thats not what i want. There is one player in the game that has level.hp = ...., I want a hud elem so EVeryone in the game can see HIS HP

  8. #8
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Anonymuis View Post
    Thats not what i want. There is one player in the game that has level.hp = ...., I want a hud elem so EVeryone in the game can see HIS HP
    Ok, got ya. Write your own then.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •