AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Display previous round information in chat (https://forums.alliedmods.net/showthread.php?t=333622)

theuser 07-25-2021 08:32

Display previous round information in chat
 
Hi
How to enable the ability to show in each round who we shot in the previous round or who shot us in the server?
Similar to the photo below

Bugsy 07-25-2021 20:07

Re: Display previous round information in chat
 
Just need to tweak it to chat print instead of show a HUD.

https://forums.alliedmods.net/showpo...33&postcount=9

theuser 07-26-2021 11:11

Re: Display previous round information in chat
 
Quote:

Originally Posted by Bugsy (Post 2753679)
Just need to tweak it to chat print instead of show a HUD.

https://forums.alliedmods.net/showpo...33&postcount=9

There are several drawbacks
Does not show damage correctly
And that I want to write is taken with a few shots and the text is exactly the same as the photo
Can you do this for me?

Bugsy 07-26-2021 11:56

Re: Display previous round information in chat
 
Yes, that can be done, give me a day or 2.

What do you mean by the damage isn't accurate? Is this because you see it go over 100? If so, I can clamp it at that.

Is this supposed to show all enemy players with damage given/taken, or only if the value is > 0 on either given or taken?

theuser 07-27-2021 03:09

Re: Display previous round information in chat
 
Quote:

Originally Posted by Bugsy (Post 2753725)
Yes, that can be done, give me a day or 2.

What do you mean by the damage isn't accurate? Is this because you see it go over 100? If so, I can clamp it at that.

Is this supposed to show all enemy players with damage given/taken, or only if the value is > 0 on either given or taken?

Yes, sometimes it is more than 100, which I want to be a maximum of 100.
And that sometimes it is not displayed correctly
For example, I do 100 damage and the plugin writes 80
thank you

Bugsy 07-27-2021 22:29

Re: Display previous round information in chat
 
Try this
PHP Code:


#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

new const Version[] = "0.1";

#define MAX_PLAYERS 32
#define MAX_NAME_LENGTH 32

enum PlayerStats
{
    
Shots,
    
DamageGiven,
    
DamageReceived
}

new 
g_pzStatsMAX_PLAYERS ][ MAX_PLAYERS ][ PlayerStats ];

public 
plugin_init() 
{
    
register_plugin"Round Damage" Version "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage" true );
    
register_logevent"RoundEnd" "1=Round_End" ); 
}

public 
HamTakeDamagevictim inflictor attacker Float:fDamage bitDamage 
{     
    new 
iActualDamage pevvictim pev_dmg_take ); 
    
    
g_pzStatsattacker ][ victim ][ Shots ]++;
    
g_pzStatsvictim ][ attacker ][ DamageReceived ] += iActualDamage;
    
g_pzStatsattacker ][ victim ][ DamageGiven ] += iActualDamage;
}

public 
RoundEnd()
{
    new 
iPlayers32 ] , iNum iAttackerPlayer iVictimPlayer iDamageGiven iDamageTaken iHealthMAX_PLAYERS ] , szNameMAX_PLAYERS ][ 32 ];
    
    
get_playersiPlayers iNum );
    
    for ( new 
iNum i++ )
    {
        
iAttackerPlayer iPlayers];
        
        for ( new 
iNum p++ )
        {
            
iVictimPlayer iPlayers];
            
            if ( ( 
!= ) && g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] || g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] )
            {
                
iDamageGiven ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] , 100 );
                
iDamageTaken ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] , 100 );
            
                if ( 
iDamageGiven || iDamageTaken )
                {
                    if ( !
iHealthiVictimPlayer ] )
                        
iHealthiVictimPlayer ] = is_user_aliveiVictimPlayer ) ? get_user_healthiVictimPlayer ) : 0;
                        
                    if ( 
szNameiVictimPlayer ][ ] == EOS )
                        
get_user_nameiVictimPlayer szNameiVictimPlayer ] , charsmaxszName[] ) );
                        
                    
client_printiAttackerPlayer print_chat "(%d with %d) damage, (%d with %d) taken, %s (%dHP)" iDamageGiven g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ Shots ] , iDamageTaken g_pzStatsiVictimPlayer ][ iAttackerPlayer ][ Shots ] , szNameiVictimPlayer ] , iHealthiVictimPlayer ] );
                }
            }
        }
    }

    
ClearArray();
}

ClearArray()
{
    for ( new 
<= MAX_PLAYERS i++ )
    {
        for ( new 
<= MAX_PLAYERS p++ )
        {
            
g_pzStats][ ][ Shots ] = 0;
            
g_pzStats][ ][ DamageGiven ] = 0;
            
g_pzStats][ ][ DamageReceived ] = 0;
        }
    }



theuser 07-28-2021 06:50

Re: Display previous round information in chat
 
Quote:

Originally Posted by Bugsy (Post 2753860)
Try this
PHP Code:


#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

new const Version[] = "0.1";

#define MAX_PLAYERS 32
#define MAX_NAME_LENGTH 32

enum PlayerStats
{
    
Shots,
    
DamageGiven,
    
DamageReceived
}

new 
g_pzStatsMAX_PLAYERS ][ MAX_PLAYERS ][ PlayerStats ];

public 
plugin_init() 
{
    
register_plugin"Round Damage" Version "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage" true );
    
register_logevent"RoundEnd" "1=Round_End" ); 
}

public 
HamTakeDamagevictim inflictor attacker Float:fDamage bitDamage 
{     
    new 
iActualDamage pevvictim pev_dmg_take ); 
    
    
g_pzStatsattacker ][ victim ][ Shots ]++;
    
g_pzStatsvictim ][ attacker ][ DamageReceived ] += iActualDamage;
    
g_pzStatsattacker ][ victim ][ DamageGiven ] += iActualDamage;
}

public 
RoundEnd()
{
    new 
iPlayers32 ] , iNum iAttackerPlayer iVictimPlayer iDamageGiven iDamageTaken iHealthMAX_PLAYERS ] , szNameMAX_PLAYERS ][ 32 ];
    
    
get_playersiPlayers iNum );
    
    for ( new 
iNum i++ )
    {
        
iAttackerPlayer iPlayers];
        
        for ( new 
iNum p++ )
        {
            
iVictimPlayer iPlayers];
            
            if ( ( 
!= ) && g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] || g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] )
            {
                
iDamageGiven ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] , 100 );
                
iDamageTaken ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] , 100 );
            
                if ( 
iDamageGiven || iDamageTaken )
                {
                    if ( !
iHealthiVictimPlayer ] )
                        
iHealthiVictimPlayer ] = is_user_aliveiVictimPlayer ) ? get_user_healthiVictimPlayer ) : 0;
                        
                    if ( 
szNameiVictimPlayer ][ ] == EOS )
                        
get_user_nameiVictimPlayer szNameiVictimPlayer ] , charsmaxszName[] ) );
                        
                    
client_printiAttackerPlayer print_chat "(%d with %d) damage, (%d with %d) taken, %s (%dHP)" iDamageGiven g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ Shots ] , iDamageTaken g_pzStatsiVictimPlayer ][ iAttackerPlayer ][ Shots ] , szNameiVictimPlayer ] , iHealthiVictimPlayer ] );
                }
            }
        }
    }

    
ClearArray();
}

ClearArray()
{
    for ( new 
<= MAX_PLAYERS i++ )
    {
        for ( new 
<= MAX_PLAYERS p++ )
        {
            
g_pzStats][ ][ Shots ] = 0;
            
g_pzStats][ ][ DamageGiven ] = 0;
            
g_pzStats][ ][ DamageReceived ] = 0;
        }
    }



And is it possible to put a command to activate and deactivate this message?
And that if I did not damage the player but he damaged me, will this plugin show?
And that the plugin does not work properly!
Does not show the damage properly.
I deal 100 damage to the opponent, for example, he writes 68
And the damage done with greenade does not count

theuser 08-07-2021 00:59

Re: Display previous round information in chat
 
:(

Bugsy 08-07-2021 21:04

Re: Display previous round information in chat
 
1. Yes, it's possible
2. If either player issued damage, it should show

theuser 08-08-2021 03:52

Re: Display previous round information in chat
 
Quote:

Originally Posted by Bugsy (Post 2754738)
1. Yes, it's possible
2. If either player issued damage, it should show

can you edit for me please?


All times are GMT -4. The time now is 12:32.

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