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

Damage Hud Death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skz
Senior Member
Join Date: Jul 2014
Location: Portugal
Old 05-05-2016 , 11:34   Damage Hud Death
Reply With Quote #1

Hi,

Im trying to make a hud message when a player is killed to show how many damage he did to others players.

I tryed this way, but nothing appears, but the way im catching the damage is correct because I already tested it.

How can I make it?

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

#define MAX_PLAYERS  32

new mDano[MAX_PLAYERS+1][MAX_PLAYERS+1]

public 
plugin_init() 
{
    
register_event("DeathMsg""Morte""a");
    
register_event("Damage""Dano""b""2!0""3=0""4!0")
}

public 
Morte(id)
{
    new 
morto read_data(2)
    new 
nome[34], hud[1102]
    new 
texto[1102]
    
    for(new 
i33i++)  
    {
        if(
mDano[morto][i] > 0)
        {
            
get_user_name(inome32);
            
format(texto1101": %i^n",mDano[morto][i])
            
add(nome33texto0);
            
add(hud1101nome0);
            
set_hudmessage(2550,01.01.000.01.0 0.10.00.0, -1);
            
show_hudmessage(mortohud);
        }
    }
}

public 
Dano(id)
{    
    static 
attackerattacker get_user_attacker(id)
    static 
damagedamage read_data(2)
    
    if( 
<= attacker <= 32)
    {  
        if(
is_user_alive(attacker) && is_user_connected(id) && cs_get_user_team(id) != cs_get_user_team(attacker))  
        {
            
mDano[attacker][id] += damage 
        
}
    } 

__________________

Last edited by skz; 05-05-2016 at 11:37.
skz is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 05-08-2016 , 01:45   Re: Damage Hud Death
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=789735 you can adapt to what you want to do
mlibre is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-08-2016 , 17:01   Re: Damage Hud Death
Reply With Quote #3

lol..
You have csstats natives , no need to count by yourself ...

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

public plugin_init() 
{
    
register_event("DeathMsg""Morte""a");
}

public 
Morte()
{
    new 
morto read_data(2)
    
    if(!
is_user_connected(morto)) return;
    
    new 
Stats[8],Body[8];
    
get_user_vstats(morto0StatsBody);
    
    
set_hudmessage(2550,01.01.000.01.0 0.10.00.0, -1);
    
show_hudmessage(morto"[STATS] You did %d damage."Stats[6]);
    


Last edited by siriusmd99; 05-08-2016 at 17:01.
siriusmd99 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 05-09-2016 , 19:36   Re: Damage Hud Death
Reply With Quote #4

Quote:
Originally Posted by siriusmd99 View Post
lol..
You have csstats natives , no need to count by yourself ...

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

public plugin_init() 
{
    
register_event("DeathMsg""Morte""a");
}

public 
Morte()
{
    new 
morto read_data(2)
    
    if(!
is_user_connected(morto)) return;
    
    new 
Stats[8],Body[8];
    
get_user_vstats(morto0StatsBody);
    
    
set_hudmessage(2550,01.01.000.01.0 0.10.00.0, -1);
    
show_hudmessage(morto"[STATS] You did %d damage."Stats[6]);
    

How can he die and not be connected?
Syturi0 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-10-2016 , 00:50   Re: Damage Hud Death
Reply With Quote #5

for safety, dont push on me .
siriusmd99 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 05-10-2016 , 01:11   Re: Damage Hud Death
Reply With Quote #6

Quote:
Originally Posted by siriusmd99 View Post
for safety, dont push on me .
Its wrong. The player cant die after he disconnects.
Syturi0 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-10-2016 , 06:29   Re: Damage Hud Death
Reply With Quote #7

it doesnt affect the code, does IT?
Will always return false and continue ...
siriusmd99 is offline
Reply


Thread Tools
Display Modes

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:11.


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