Raised This Month: $ Target: $400
 0% 

Instant kill [attack 2]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-30-2019 , 12:32   Instant kill [attack 2]
Reply With Quote #1

PHP Code:
/************************************************
    One Hit Knife Kills
    Author: Rabid Baboon
    Version: 1.3
    Mod: Counter-Strike
    Requires: AMX mod X v1.01
    Required Modules: cstrike, fakemeta engine and csx
    Description:
        Kills a player in one hit from the knife.
    
    Special Thanks:
        FireStorm  - For the sucide message block function.
    
    Changelog:
        v1.3
            Fixed getting knife kills when another player takes fall damage.
        v1.2
            Blocked sucide message from knife kills.
        v1.1
            Self-kill from fall damage while knife is out fixed.
************************************************/
#include <amxmodx>
#include <cstrike>
#include <csx>
#include <fakemeta>
#include <engine>
#include <engine_stocks>
#include <fun>
/************************************************ 
    Global Variables
************************************************/
new knifekill 0
/************************************************
    Main Functions
************************************************/
/************************************************
    plugin_modules()
        Required modules listed here. Plugin will not work if they are not loaded.
************************************************/
public plugin_modules()
{
    
require_module("cstrike");
    
require_module("csx");
    
require_module("fakemeta");
    
require_module("engine");
}
/************************************************
    plugin_init()
        Initializes the plugin.
************************************************/
public plugin_init()
{
    
register_plugin("One Hit Knife Kills""1.3""Rabid Baboon")
    
register_forward(FM_AlertMessage,"blocksuicide"
    
    return 
PLUGIN_HANDLED
}
/************************************************
    client_damage(attacker, victim, damage, wpnindex, hitplace, TA)
        Kills a player if he was damaged by a knife.
        Called when a player takes damage
************************************************/
public client_damage(attackervictimdamagewpnindexhitplaceTA)
{    
    if(
is_user_alive(victim))
    {
        if((
attacker != victim)) //prevents killing self with knife from fall damage.
        
{
            if(
wpnindex == CSW_KNIFE && TA != 1)
            {
                if(
damage != DMG_FALL)
                {
                    
knifekill 1
                    
if(hitplace == HIT_HEAD)
                    {
                        
make_deathmsg(attackervictim1"knife")
                    }
                    else
                    {
                        
make_deathmsg(attackervictim0"knife")
                    }
                    
user_silentkill(victim)
                    
set_user_frags(attackerget_user_frags(attacker)+1)
                }            
            }
        }
    }
            
    return 
PLUGIN_HANDLED
}
/************************************************
    blocksuicide(at_type, message[])
        Blocks the sucide message caused user_silentkill        
************************************************/
public blocksuicide(at_typemessage[])
{
    if(
containi(message,"suicide") > -&& containi(message,"world") > -&& knifekill == 1)
    {
        
knifekill 0
        
return FMRES_SUPERCEDE
    
}
    return 
PLUGIN_CONTINUE

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
could someone make it to work only on attack 2, so if you are using knife with attack 1, it should be normally, but if you use attack 2 (right click) then you have instant kill
or any other plugin that does that? i searched but havent found anything (supercut, superknife, etc)
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-30-2019 , 14:13   Re: Instant kill [attack 2]
Reply With Quote #2

Code:
public client_damage(attacker, victim, damage, wpnindex, hitplace, TA) 
{     
    if(is_user_alive(victim)) 
    { 
        if((attacker != victim)) //prevents killing self with knife from fall damage. 
        { 
            if(wpnindex == CSW_KNIFE && TA != 1) 
            { 
                if(damage != DMG_FALL) 
                { 
                    if (pev(attacker,pev_button) & IN_ATTACK2)
                    {
                        knifekill = 1 
                        if(hitplace == HIT_HEAD) 
                        { 
                            make_deathmsg(attacker, victim, 1, "knife") 
                        } 
                        else 
                        { 
                            make_deathmsg(attacker, victim, 0, "knife") 
                        } 
                        user_silentkill(victim) 
                        set_user_frags(attacker, get_user_frags(attacker)+1) 
                    }
                }             
            } 
        } 
    } 
             
    return PLUGIN_HANDLED 
}

Last edited by raizo11; 01-30-2019 at 14:14.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-30-2019 , 15:12   Re: Instant kill [attack 2]
Reply With Quote #3

it kinda works but it doesnt always kill instantly, the instant kill from ATTACK 1 doesnt work, so that's good, but the only problem is that, sometimes it doesnt kill instantly by using attack 2
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-30-2019 , 16:08   Re: Instant kill [attack 2]
Reply With Quote #4

Try with pev_oldbutton. Also, you do not need cstrike, engine and engine_stocks include.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-30-2019 at 16:13.
EFFx 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 07:30.


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