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

Solved [REQUEST][Half-Life] Vampire plugin edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tiltedShrimp
Member
Join Date: Feb 2024
Old 03-09-2024 , 13:45   [REQUEST][Half-Life] Vampire plugin edit
Reply With Quote #1

Hey !
Im running a plugin on my Half-Life server which adds +5 HP & +5 AP to a killer (upon getting a successful kill). The plugin works great, but for new players it's not that obvious that this feature even exists. It would be nice if someone could edit it so that the plugin would display a message just under the crosshair (or in that general area) "+5 HP & +5 AP !" whenever a player gets a kill, also a line in the code for a color code for that message would be nice as I'd like to customize it to my desire.

Thank you !
Attached Files
File Type: sma Get Plugin or Get Source (vampire.sma - 37 views - 1.2 KB)

Last edited by tiltedShrimp; 03-09-2024 at 16:57.
tiltedShrimp is offline
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 03-09-2024 , 16:47   Re: [REQUEST][Half-Life] Vampire plugin edit
Reply With Quote #2

Here you go

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>

#define AUTHOR "Turanga_Leela, Lev @ AGHL.RU DevTeam"
#define PLUGIN "Vampire"
#define VERSION "0.2"
#define VERSION_CVAR "vampire_version"

#define I_MAX 999 // change max Hp & Ap

new const m_LastHitGroup 90;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_cvar(VERSION_CVARVERSIONFCVAR_SERVER FCVAR_SPONLY FCVAR_UNLOGGED);

    
register_event("DeathMsg""OnDeathMsg""a");
}

public 
OnDeathMsg()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
hitplace get_pdata_int(victimm_LastHitGroup);

    new 
health get_user_health(killer);
    if (
health && is_user_alive(killer))
    {
        new 
irandom 5;


        if (
health I_MAX)
        {
            
health += irandom;
            if (
health I_MAX)
                
health I_MAX;
            
set_user_health(killerhealth);
        }

        new 
armor get_user_armor(killer);
        if (
armor I_MAX)
        {
            
armor += irandom;
            if (
armor I_MAX)
                
armor I_MAX;
            
set_user_armor(killerarmor);
        }
        
    
set_hudmessage(0255255, -1.00.2507.05.01.00.00.0);
    new 
message[64];
    
format(messagesizeof(message), "+5HP | +5AP");
    
show_hudmessage(killermessage);
    }

Uzviseni Bog is offline
tiltedShrimp
Member
Join Date: Feb 2024
Old 03-09-2024 , 16:57   Re: [REQUEST][Half-Life] Vampire plugin edit
Reply With Quote #3

Quote:
Originally Posted by Uzviseni Bog View Post
Here you go

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>

#define AUTHOR "Turanga_Leela, Lev @ AGHL.RU DevTeam"
#define PLUGIN "Vampire"
#define VERSION "0.2"
#define VERSION_CVAR "vampire_version"

#define I_MAX 999 // change max Hp & Ap

new const m_LastHitGroup 90;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_cvar(VERSION_CVARVERSIONFCVAR_SERVER FCVAR_SPONLY FCVAR_UNLOGGED);

    
register_event("DeathMsg""OnDeathMsg""a");
}

public 
OnDeathMsg()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
hitplace get_pdata_int(victimm_LastHitGroup);

    new 
health get_user_health(killer);
    if (
health && is_user_alive(killer))
    {
        new 
irandom 5;


        if (
health I_MAX)
        {
            
health += irandom;
            if (
health I_MAX)
                
health I_MAX;
            
set_user_health(killerhealth);
        }

        new 
armor get_user_armor(killer);
        if (
armor I_MAX)
        {
            
armor += irandom;
            if (
armor I_MAX)
                
armor I_MAX;
            
set_user_armor(killerarmor);
        }
        
    
set_hudmessage(0255255, -1.00.2507.05.01.00.00.0);
    new 
message[64];
    
format(messagesizeof(message), "+5HP | +5AP");
    
show_hudmessage(killermessage);
    }

Tested, works wonderfully, thank you so much good sir !
tiltedShrimp 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 00:52.


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