This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Med-Shot or Healthshot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ismaylwo
Junior Member
Join Date: Dec 2022
Old 12-15-2022 , 23:59   Med-Shot or Healthshot
Reply With Quote #1

Hello, is there an analogue of Med-Shot from CS GO for CS 1.6, a plugin for the syringe to be issued after three kills?
Ismaylwo is offline
administratora
Member
Join Date: Mar 2015
Old 12-18-2022 , 09:27   Re: Med-Shot or Healthshot
Reply With Quote #2

Hi, I think no but I will give you an example:

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

new g_killCount[33]; // Array to store the kill count for each player

public plugin_init()
{
    
register_plugin("Syringe After Three Kills""1.0""Your Name");

    
// Register the "death" event to track player kills
    
register_event("death""Death""a");
}

public 
Death(id)
{
    
// Increment the player's kill count
    
g_killCount[id]++;

    
// Check if the player has made three kills
    
if (g_killCount[id] == 3)
    {
        
// Give the player a syringe
        
give_item(id"item_kevlar");

        
// Reset the player's kill count
        
g_killCount[id] = 0;
    }

You can modify the number of kills (from the code) required to earn a syringe, as well as the item that is given to the player (in this example, it is a Kevlar vest, which can be used as a makeshift syringe)

Last edited by administratora; 12-18-2022 at 13:02.
administratora is offline
Ismaylwo
Junior Member
Join Date: Dec 2022
Old 12-18-2022 , 23:56   Re: Med-Shot or Healthshot
Reply With Quote #3

Quote:
Originally Posted by administratora View Post
Hi, I think no but I will give you an example:

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

new g_killCount[33]; // Array to store the kill count for each player

public plugin_init()
{
    
register_plugin("Syringe After Three Kills""1.0""Your Name");

    
// Register the "death" event to track player kills
    
register_event("death""Death""a");
}

public 
Death(id)
{
    
// Increment the player's kill count
    
g_killCount[id]++;

    
// Check if the player has made three kills
    
if (g_killCount[id] == 3)
    {
        
// Give the player a syringe
        
give_item(id"item_kevlar");

        
// Reset the player's kill count
        
g_killCount[id] = 0;
    }

You can modify the number of kills (from the code) required to earn a syringe, as well as the item that is given to the player (in this example, it is a Kevlar vest, which can be used as a makeshift syringe)
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

#pragma semicolon 1

//Настройки
#define HEAL        25.0    // Amount of health to be restored
#define MAXHEALTH    100.0    //Health threshold
#define VIP_AMMO    2        //Number of syringes for VIP 
#define PLR_AMMO    1        //Number of syringes for a normal player
#define FLAG    ADMIN_LEVEL_H    // VIP flag

#define ANIM_USE        0
#define OLD_KN_DRAW        3
#define TIME_ANIM_HEAL    2.0
#define TIME_DRAW_KNF    1.1

#define TASK_HEAL        25071973

#define is_valid_player(%0)     (1 <= %0 <= g_maxplayers)
const m_flNextAttack 83;

new const 
v_injectorX[]    = "models/v_injectorX.mdl"// v_ syringe model
new const p_injectorX[]    = "models/p_injectorX.mdl"// p_ syringe model

new const v_old_knife[]    = "models/v_knife.mdl"// v_ knife model that is returned after use 
new const p_old_knife[]    = "models/p_knife.mdl"// p_ knife model that is returned after use
                                               // If there are several knife models, then return the model through the native!

new const heal_sound[]    = { "items/medshot4.wav" };    // Heal sound

new shpr_ammo[33];
new 
g_maxplayers;
public 
plugin_init()
{    
    
register_plugin("Injector X & Syringe After Three kills""1.0""Alliedmods");
    
register_clcmd("drop""use_inj");
    
RegisterHam(Ham_Spawn"player""ham_spawn_post"1);
    
RegisterHam(Ham_Item_Holster"weapon_knife""fw_Knife_Holstered"1);

    
    
g_maxplayers get_maxplayers();
}

public 
plugin_precache() 
{
    
precache_model(v_injectorX);
    
precache_model(p_injectorX);
    
precache_model(v_old_knife);
    
precache_model(p_old_knife);
    
precache_sound(heal_sound);

}

public 
ham_spawn_post(id)
{
    if(
get_user_flags(id) & FLAG)
        
shpr_ammo[id] = VIP_AMMO;
        
    else 
shpr_ammo[id] = PLR_AMMO;
}



public 
use_inj(id)
{
    if(!
is_user_alive(id))
        return;

    if(
get_user_weapon(id) != CSW_KNIFE || !shpr_ammo[id])
        return;
        
    
remove_task(id+TASK_HEAL);
    
set_pdata_float(idm_flNextAttackTIME_ANIM_HEAL+0.15);

    
set_pev(idpev_viewmodel2v_injectorX);
    
set_pev(idpev_weaponmodel2p_injectorX);

    
play_weapon_animation(idANIM_USE);
    
set_task(TIME_ANIM_HEAL"use_inj2"id+TASK_HEAL);
    
}

public 
use_inj2(id)
{
    
id -= TASK_HEAL;

    if(
is_user_alive(id))
    {
        
shpr_ammo[id]--;
        
set_pev(idpev_viewmodel2v_old_knife);
        
set_pev(idpev_weaponmodel2p_old_knife);
        
set_pdata_float(idm_flNextAttackTIME_DRAW_KNF5);
        
play_weapon_animation(idOLD_KN_DRAW);
        
set_hp(id);
    }
}

public 
fw_Knife_Holstered(weapon)
{
    new 
id get_pdata_cbase(weapon414);
    
    if(!
pev_valid(weapon))
        return 
HAM_IGNORED;

    if(
is_valid_player(id))
        
remove_task(id+TASK_HEAL);
    
    return 
HAM_IGNORED;

}

stock set_hp(plr)
{
    new 
hp pev(plrpev_health);

    if(
hp MAXHEALTH)
    {
        if(
hp HEAL MAXHEALTH)
            
set_pev(plrpev_healthMAXHEALTH);
        else 
set_pev(plrpev_healthhp HEAL);
        
emit_sound(plrCHAN_BODYheal_sound1.0ATTN_NORM0PITCH_NORM);
    }
}

stock play_weapon_animation(const Player, const Sequence)
{
    
set_pev(Playerpev_weaponanimSequence);
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player Player);
    
write_byte(Sequence);
    
write_byte(pev(Playerpev_body));
    
message_end();


there is such a plugin how to change and add your code, and hud message (you got a syringe for three kills
to use take a knife and press G ) after three kills you got a syringe

Last edited by Ismaylwo; 12-19-2022 at 00:47.
Ismaylwo 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 14:32.


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