Raised This Month: $51 Target: $400
 12% 

[REQUEST] Player Info display on HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 06-12-2015 , 04:39   [REQUEST] Player Info display on HUD
Reply With Quote #1

Hi, I was edit that plugin (https://forums.alliedmods.net/showthread.php?t=257911) that plugin was show just aimed player's name than @m_bNightstalker was helped me. plugin show player's name and HP someone can add. Aimed player is Friend or a enemy and whan aimed to space display in hud just '.' like that;

HUD;
Code:
Playername 
100 HP (Enemy)
HUD Aimed on space;
Code:
.






PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

#define PLUGIN_VERSION   "1.0"

public Plugin:myinfo =
{
    
name "Show nickname on HUD",
    
author "Graffiti",
    
description "Show nickname on HUD for CSGO",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
};

public 
OnPluginStart()
{
    
CreateConVar("sm_show_nickname_on_hud_version"PLUGIN_VERSION"Show nickname on HUD"FCVAR_PLUGIN FCVAR_SPONLY FCVAR_DONTRECORD FCVAR_NOTIFY);
    
CreateTimer(0.5Timer_TIMER_REPEAT);
}

stock TraceClientViewEntity(client)
{
    new 
Float:m_vecOrigin[3];
    new 
Float:m_angRotation[3];

    
GetClientEyePosition(clientm_vecOrigin);
    
GetClientEyeAngles(clientm_angRotation);

    new 
Handle:tr TR_TraceRayFilterEx(m_vecOriginm_angRotationMASK_VISIBLERayType_InfiniteTRDontHitSelfclient);
    new 
pEntity = -1;

    if (
TR_DidHit(tr))
    {
        
pEntity TR_GetEntityIndex(tr);
        
CloseHandle(tr);
        return 
pEntity;
    }

    if(
tr != INVALID_HANDLE)
    {
        
CloseHandle(tr);
    }
    
    return -
1;
}

public 
bool:TRDontHitSelf(entitymaskany:data)
{
    return (
<= entity <= MaxClients && entity != data); 
}

public 
Action:Timer(Handle:timer)
{
    for(new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            new 
target TraceClientViewEntity(i);
            if(
target && target <= MaxClients && IsClientInGame(target) && IsPlayerAlive(target))
            {
                
PrintHintText(i"\"%N\ /n %i HP"", target, GetClientHealth(target));
            }
        }
    }
    return Plugin_Continue; 


Last edited by spancer35; 03-14-2016 at 13:22. Reason: New req :DD
spancer35 is offline
m_bNightstalker
Senior Member
Join Date: Jan 2015
Location: JWD
Old 06-12-2015 , 06:22   Re: [REQUEST] Health Display on HUD
Reply With Quote #2

Quote:
Originally Posted by spancer35 View Post
Hi, I found that plugin (https://forums.alliedmods.net/showthread.php?t=257911) but this plugin just show nick name on HUD but i want show player HP too on HUD .somebody can edit it for me? (sory for my bad english )


like that; (paint master )

Spoiler



Please don't create multiple threads about the same thing...and you couldn't wait a full day, there is a edit button, please!


anyway thats what you need:
PrintHintText(i, "HP: \"%d\"", GetClientHealth(target));
m_bNightstalker is offline
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 03-14-2016 , 13:22   Re: [REQUEST] Player Info display on HUD
Reply With Quote #3

up
__________________
spancer35 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-15-2016 , 10:31   Re: [REQUEST] Player Info display on HUD
Reply With Quote #4

Quote:
Originally Posted by spancer35 View Post
up
Quote:
Originally Posted by m_bNightstalker View Post
Please don't create multiple threads about the same thing...and you couldn't wait a full day, there is a edit button, please!


anyway thats what you need:
PrintHintText(i, "HP: \"%d\"", GetClientHealth(target));
__________________
Want to check my plugins ?

Last edited by Arkarr; 03-15-2016 at 10:31.
Arkarr is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-16-2016 , 12:20  
Reply With Quote #5

Try this plugin.
CVar: sm_player_hint_info - 0 - Not show info, 1 - Show HP to all, 2 - Show HP only to allies
Attached Files
File Type: sp Get Plugin or Get Source (player_hint_info.sp - 728 views - 2.5 KB)
__________________
Grey83 is offline
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 03-16-2016 , 15:13   Re: [REQUEST] Player Info display on HUD
Reply With Quote #6

Quote:
Originally Posted by Grey83 View Post
Try this plugin.
CVar: sm_player_hint_info - 0 - Not show info, 1 - Show HP to all, 2 - Show HP only to allies
Thank you Grey83! Can you add a cvar as sm_hint_info_alive 1/0 for alive players use this too?

and
Quote:
Originally Posted by spancer35 View Post
HUD will show when player Aimed to space;
Code:
.
__________________

Last edited by spancer35; 03-16-2016 at 15:20.
spancer35 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-16-2016 , 16:15  
Reply With Quote #7

Quote:
HUD will show when player Aimed to space
What is the meaning of this action?

In v1.0.1 added CVars:
  • sm_hint_info_alive - 0 - Show info only to dead, 1 - Show info to all
  • sm_hint_info_wtf - 1 - Show dot if aim is not directed at the player, 0 - Don't show dot
Attached Files
File Type: sp Get Plugin or Get Source (player_hint_info 1.0.1.sp - 908 views - 3.3 KB)
__________________

Last edited by Grey83; 03-16-2016 at 16:16.
Grey83 is offline
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 03-16-2016 , 16:51   Re: [REQUEST] Player Info display on HUD
Reply With Quote #8

Quote:
Originally Posted by Grey83 View Post
What is the meaning of this action?

In v1.0.1 added CVars:
  • sm_hint_info_alive - 0 - Show info only to dead, 1 - Show info to all
  • sm_hint_info_wtf - 1 - Show dot if aim is not directed at the player, 0 - Don't show dot
Ahahahahahah. I like the cvar name My english is soooo bad im so sorry about this. Then about plugin. I think now it's ok. i'll try then i'll report here.
__________________
spancer35 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-16-2016 , 18:28  
Reply With Quote #9

Try this. Maybe this is what you wanted
Attached Files
File Type: sp Get Plugin or Get Source (player_hint_info 1.0.2.sp - 1077 views - 3.5 KB)
__________________
Grey83 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 10-14-2019 , 02:57   Re: [REQUEST] Player Info display on HUD
Reply With Quote #10

The latest version can be found here: GitHub
__________________
Grey83 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 00:38.


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