Raised This Month: $32 Target: $400
 8% 

Show damage HUD plugin REQUEST


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
inlovecs
Member
Join Date: Dec 2012
Old 03-08-2019 , 16:30   Show damage HUD plugin REQUEST
Reply With Quote #1

Hello,i'm using Zombie Plague mod and i can't find a good plugin that shows bullet damage in hud like in CS 1.6.

I already searched every plugin and don't work.

This plugin shows only the last hit that kills that zombie/human and i want something to show all bullets damage. Can someone help me ?

Code:
public OnPluginStart()
{
	HookEvent("player_hurt", Event_PlayerHurt);
}

public Action Event_PlayerHurt(Handle event, char[] name, bool dontBroadcast)
{
	int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
	int victim = GetClientOfUserId(GetEventInt(event, "userid"));
	int damage_health = GetEventInt(event, "dmg_health");
	if (!IsValidClient(attacker) || !IsValidClient(victim) || attacker == victim)
		return Plugin_Continue;
	
	if (GetClientTeam(victim) == 3)
		SetHudTextParams(0.5, 0.5, 1.0, 2, 2, 252, 1, 0);
	else
		SetHudTextParams(0.5, 0.5, 1.0, 252, 2, 2, 1, 0);
	
	ShowHudText(attacker, 1, "%d", damage_health);
	return Plugin_Continue;
}


bool IsValidClient(int client)
{
	if (!(1 <= client <= MaxClients) || !IsClientInGame(client))
		return false;
	
	return true;
}
__________________

inlovecs is offline
Nexd
BANNED
Join Date: Dec 2013
Location: Hungary
Old 03-08-2019 , 16:36   Re: Show damage HUD plugin REQUEST
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=264427
Nexd is offline
inlovecs
Member
Join Date: Dec 2012
Old 03-08-2019 , 16:41   Re: Show damage HUD plugin REQUEST
Reply With Quote #3

Tried that,didn't work.
__________________

inlovecs is offline
Nexd
BANNED
Join Date: Dec 2013
Location: Hungary
Old 03-08-2019 , 16:45   Re: Show damage HUD plugin REQUEST
Reply With Quote #4

Works well for me
Nexd is offline
JeffTM1TAP
Member
Join Date: Dec 2018
Old 03-12-2019 , 15:37   Re: Show damage HUD plugin REQUEST
Reply With Quote #5

https://forums.alliedmods.net/showthread.php?p=2359028
__________________
JeffTM1TAP is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 03-14-2019 , 09:28   Re: Show damage HUD plugin REQUEST
Reply With Quote #6

PHP Code:
public Action Event_PlayerHurt(Handle eventchar[] namebool dontBroadcast)
{
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
    
int damage_health GetEventInt(event"dmg_health");
    
        if (
GetClientTeam(victim) == 3)
        {
        
SetHudTextParams(0.50.51.02225210);
        
ShowHudText(victim1"%i"damage_health);
        
SetHudTextParams(0.50.51.02522210);
        
ShowHudText(attacker1"%i"damage_health);
        }
        return 
Plugin_Continue;

Untested
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 03-14-2019 , 11:12   Re: Show damage HUD plugin REQUEST
Reply With Quote #7

Quote:
Originally Posted by Pilo View Post
PHP Code:
public Action Event_PlayerHurt(Handle eventchar[] namebool dontBroadcast)
{
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
    
int damage_health GetEventInt(event"dmg_health");
    
        if (
GetClientTeam(victim) == 3)
        {
        
SetHudTextParams(0.50.51.02225210);
        
ShowHudText(victim1"%i"damage_health);
        
SetHudTextParams(0.50.51.02522210);
        
ShowHudText(attacker1"%i"damage_health);
        }
        return 
Plugin_Continue;

Untested
Verify that the attacker is a client and use a hudsync instead with 'CreateHudSynchronizer'.
Drixevel is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 03-14-2019 , 14:00   Re: Show damage HUD plugin REQUEST
Reply With Quote #8

PHP Code:
public Action Event_PlayerHurt(Handle eventchar[] namebool dontBroadcast

    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
int victim GetClientOfUserId(event.GetInt("userid"));
    
int damage_health GetEventInt(event"dmg_health"); 
     
        { 
        
SetHudTextParams(0.50.51.02225210); 
        
ShowHudText(victim1"%i"damage_health); 
        
SetHudTextParams(0.50.51.02522210); 
        
ShowHudText(attacker1"%i"damage_health); 
        } 
        return 
Plugin_Continue

Edit
Code:
 int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
to
Code:
int attacker = GetClientOfUserId(event.GetInt("attacker"));
Does it matter anyway?
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$

Last edited by Pilo; 03-14-2019 at 14:01.
Pilo is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 03-14-2019 , 18:45   Re: Show damage HUD plugin REQUEST
Reply With Quote #9

Quote:
Originally Posted by Pilo View Post
PHP Code:
public Action Event_PlayerHurt(Handle eventchar[] namebool dontBroadcast

    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
int victim GetClientOfUserId(event.GetInt("userid"));
    
int damage_health GetEventInt(event"dmg_health"); 
     
        { 
        
SetHudTextParams(0.50.51.02225210); 
        
ShowHudText(victim1"%i"damage_health); 
        
SetHudTextParams(0.50.51.02522210); 
        
ShowHudText(attacker1"%i"damage_health); 
        } 
        return 
Plugin_Continue

Edit
Code:
 int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
to
Code:
int attacker = GetClientOfUserId(event.GetInt("attacker"));
Does it matter anyway?
He meant
Code:
int attacker = GetClientOfUserId(event.GetInt("attacker"));
if(attacker <= 0 || attacker > MaxClients) return Plugin_Continue;
CliptonHeist is offline
Gena
Member
Join Date: May 2022
Location: Uruguay
Old 05-24-2022 , 21:09   Re: Show damage HUD plugin REQUEST
Reply With Quote #10

I don't know if that worked for you, but I'll leave you with this one.
https://forums.alliedmods.net/showthread.php?t=337879
__________________
Servers of CS:GO - Private Plugins
Steam ~ GenaEscobar#2338
sorry for my english as a translator d:
Gena 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 19:25.


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