Raised This Month: $51 Target: $400
 12% 

Solved HP info chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JOnDark
Member
Join Date: Jan 2019
Old 05-23-2020 , 10:35   HP info chat
Reply With Quote #1

Hi guys, can someone tell me where I can find a plugin to show when you're dead how much life the other one had? Or something like that but just life.

Last edited by JOnDark; 05-30-2020 at 20:06.
JOnDark is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 05-28-2020 , 20:16   Re: HP info chat
Reply With Quote #2

Quote:
Originally Posted by JOnDark View Post
Hi guys, can someone tell me where I can find a plugin to show when you're dead how much life the other one had? Or something like that but just life.
PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>
//#include <sdkhooks>

#pragma newdecls required


public Plugin myinfo 
{
    
name "",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);
}
public 
Action Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
        
int userid GetClientOfUserId(event.GetInt("userid"));
        
int attacker GetClientOfUserId(event.GetInt("attacker"));
        
int hp GetClientHealth(attacker);
        if(
hp==0)
        
PrintToChat(userid"Don't suicide its not healthy");
        else
        
PrintToChat(userid"Your killer had %d HP"hp);

Attached Files
File Type: sp Get Plugin or Get Source (AttackersHP.sp - 151 views - 814 Bytes)

Last edited by SSheriFF; 06-22-2020 at 13:01.
SSheriFF is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 05-29-2020 , 07:31   Re: HP info chat
Reply With Quote #3

PHP Code:
public void OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);
}
public 
Action Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    
int userid GetClientOfUserId(event.GetInt("userid"));
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    if (
attacker == userid)
        
PrintToChat(attacker"Don't suicide it's not healthy :D");
    else
        
PrintToChat(userid"You died to \x02%N\x01, he has \x04%i\x01 HP"attackerGetClientHealth(attacker));

Not sure about
Code:
 if(hp==0)
so just try this
__________________

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; 05-29-2020 at 07:32.
Pilo is offline
JOnDark
Member
Join Date: Jan 2019
Old 05-30-2020 , 20:06   Re: HP info chat
Reply With Quote #4

Ty guys
JOnDark is offline
XHUNTERX
Senior Member
Join Date: Aug 2019
Location: World
Old 06-05-2020 , 02:58   Re: HP info chat
Reply With Quote #5

Code:
L 06/05/2020 - 00:19:53: [SM] Call stack trace:
L 06/05/2020 - 00:19:53: [SM]   [0] GetClientHealth
L 06/05/2020 - 00:19:53: [SM]   [1] Line 33, E:\SV\SM COMPILE\sourcemod-1.10.0-git6456-windows\addons\sourcemod\scripting\hpinfochat.sp::Event_PlayerDeath
L 06/05/2020 - 00:23:17: [SM] Exception reported: Client index 0 is invalid
L 06/05/2020 - 00:23:17: [SM] Blaming: hpinfochat.smx
L 06/05/2020 - 00:23:17: [SM] Call stack trace:
L 06/05/2020 - 00:23:17: [SM]   [0] GetClientHealth
L 06/05/2020 - 00:23:17: [SM]   [1] Line 33, E:\SV\SM COMPILE\sourcemod-1.10.0-git6456-windows\addons\sourcemod\scripting\hpinfochat.sp::Event_PlayerDeath
L 06/05/2020 - 00:26:08: Error log file session closed.
XHUNTERX is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 06-05-2020 , 05:35   Re: HP info chat
Reply With Quote #6

Quote:
Originally Posted by XHUNTERX View Post
Code:
L 06/05/2020 - 00:19:53: [SM] Call stack trace:
L 06/05/2020 - 00:19:53: [SM]   [0] GetClientHealth
L 06/05/2020 - 00:19:53: [SM]   [1] Line 33, E:\SV\SM COMPILE\sourcemod-1.10.0-git6456-windows\addons\sourcemod\scripting\hpinfochat.sp::Event_PlayerDeath
L 06/05/2020 - 00:23:17: [SM] Exception reported: Client index 0 is invalid
L 06/05/2020 - 00:23:17: [SM] Blaming: hpinfochat.smx
L 06/05/2020 - 00:23:17: [SM] Call stack trace:
L 06/05/2020 - 00:23:17: [SM]   [0] GetClientHealth
L 06/05/2020 - 00:23:17: [SM]   [1] Line 33, E:\SV\SM COMPILE\sourcemod-1.10.0-git6456-windows\addons\sourcemod\scripting\hpinfochat.sp::Event_PlayerDeath
L 06/05/2020 - 00:26:08: Error log file session closed.
Just use Pilo's code it will fix it.
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF 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 06:09.


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