AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [CS:GO][REQ] Show Damage (https://forums.alliedmods.net/showthread.php?t=317746)

trickgod 07-27-2019 19:45

[CS:GO][REQ] Show Damage
 
DR.API Show Damage Not Working

Please make a simple plugin
Print Hint Text "<PLAYERNAME> Give Damage <- HP>"
Print Hint Text "<PLAYERNAME> Killed"

And It Will Be Very Beautiful If You Can Make Texts Colored

Nexd 07-27-2019 20:47

Re: [CS:GO][REQ] Show Damage
 
https://forums.alliedmods.net/showthread.php?p=2315058

trickgod 07-27-2019 21:32

Re: [CS:GO][REQ] Show Damage
 
Quote:

Originally Posted by Nexd (Post 2660880)

not working on my server

trickgod 07-27-2019 21:45

Re: [CS:GO][REQ] Show Damage
 
I really need this. Please anyone making a simple plugin :(

Pilo 07-28-2019 08:51

Re: [CS:GO][REQ] Show Damage
 
PHP Code:

#include <sourcemod>

public void OnPluginStart()
{
    
HookEvent("player_hurt"Event_PlayerHurt);
    
HookEvent("player_death"Event_PlayerDeath);
}

public 
Action Event_PlayerHurt(Event event, const char[] namebool dB)
{
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
int victim GetClientOfUserId(event.GetInt("userid"));
    
int damage event.GetInt("dmg_health");
    
    if (
IsClientInGame(attacker) && IsClientInGame(victim))
    {
        if (!
IsFakeClient(attacker) && !IsFakeClient(victim))
        {
            if (
attacker != victim)
            {
                
PrintHintText(attacker"%i Damage to %N"damagevictim);
            }
        }
    }
    return 
Plugin_Continue;
}

public 
Action Event_PlayerDeath(Event event, const char[] namebool dB)
{
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
int victim GetClientOfUserId(event.GetInt("userid"));
    
    if (
IsClientInGame(attacker) && IsClientInGame(victim))
    {
        if (!
IsFakeClient(attacker) && !IsFakeClient(victim))
        {
            if (
attacker != victim)
            {
                
PrintHintText(attacker"%N Killed"victim);
            }
        }
    }
    return 
Plugin_Continue;


Untested.

trickgod 07-28-2019 10:31

Re: [CS:GO][REQ] Show Damage
 
Quote:

Originally Posted by Pilo (Post 2660944)
PHP Code:

#include <sourcemod>

public void OnPluginStart()
{
    
HookEvent("player_hurt"Event_PlayerHurt);
    
HookEvent("player_death"Event_PlayerDeath);
}

public 
Action Event_PlayerHurt(Event event, const char[] namebool dB)
{
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
int victim GetClientOfUserId(event.GetInt("userid"));
    
int damage event.GetInt("dmg_health");
    
    if (
IsClientInGame(attacker) && IsClientInGame(victim))
    {
        if (!
IsFakeClient(attacker) && !IsFakeClient(victim))
        {
            if (
attacker != victim)
            {
                
PrintHintText(attacker"%i Damage to %N"damagevictim);
            }
        }
    }
    return 
Plugin_Continue;
}

public 
Action Event_PlayerDeath(Event event, const char[] namebool dB)
{
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    
int victim GetClientOfUserId(event.GetInt("userid"));
    
    if (
IsClientInGame(attacker) && IsClientInGame(victim))
    {
        if (!
IsFakeClient(attacker) && !IsFakeClient(victim))
        {
            if (
attacker != victim)
            {
                
PrintHintText(attacker"%N Killed"victim);
            }
        }
    }
    return 
Plugin_Continue;


Untested.

Killed Hint Text Working But Damage To Hint Text Not Working can you solve ?

Shane1390 07-28-2019 13:54

Re: [CS:GO][REQ] Show Damage
 
1 Attachment(s)
Edit of a plugin made by AntiTeal, I added the menu (w/ settings), as well as hitmarkers, removed the zombies dependency, added colors (similar to a popular csgo server).

I made this edit a while ago and the code definitely needs to get cleaned up
Requires: https://forums.alliedmods.net/showthread.php?t=185016

Screenies:

trickgod 07-28-2019 17:53

Re: [CS:GO][REQ] Show Damage
 
Quote:

Originally Posted by Shane1390 (Post 2660979)
Edit of a plugin made by AntiTeal, I added the menu (w/ settings), as well as hitmarkers, removed the zombies dependency, added colors (similar to a popular csgo server).

I made this edit a while ago and the code definitely needs to get cleaned up
Requires: https://forums.alliedmods.net/showthread.php?t=185016

Screenies:

Wow, thanks its works

Franc1sco 07-29-2019 04:01

Re: [CS:GO][REQ] Show Damage
 
Quote:

Originally Posted by trickgod (Post 2660873)
DR.API Show Damage Not Working

Please make a simple plugin
Print Hint Text "<PLAYERNAME> Give Damage <- HP>"
Print Hint Text "<PLAYERNAME> Killed"

And It Will Be Very Beautiful If You Can Make Texts Colored

My showdamage plugin works well -> https://forums.alliedmods.net/showthread.php?p=2359028


All times are GMT -4. The time now is 13:43.

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