AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Damage Hud Death (https://forums.alliedmods.net/showthread.php?t=282378)

skz 05-05-2016 11:34

Damage Hud Death
 
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 
        
}
    } 



mlibre 05-08-2016 01:45

Re: Damage Hud Death
 
https://forums.alliedmods.net/showthread.php?p=789735 you can adapt to what you want to do

siriusmd99 05-08-2016 17:01

Re: Damage Hud Death
 
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]);
    



Syturi0 05-09-2016 19:36

Re: Damage Hud Death
 
Quote:

Originally Posted by siriusmd99 (Post 2417727)
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?

siriusmd99 05-10-2016 00:50

Re: Damage Hud Death
 
for safety, dont push on me :).

Syturi0 05-10-2016 01:11

Re: Damage Hud Death
 
Quote:

Originally Posted by siriusmd99 (Post 2418007)
for safety, dont push on me :).

Its wrong. The player cant die after he disconnects.

siriusmd99 05-10-2016 06:29

Re: Damage Hud Death
 
it doesnt affect the code, does IT?
Will always return false and continue ...


All times are GMT -4. The time now is 18:45.

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