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

[Request] HNS Slow After Dealing Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NEXO.
Member
Join Date: May 2016
Location: Pakistan
Old 04-08-2019 , 09:05   [Request] HNS Slow After Dealing Damage
Reply With Quote #1

Hi guys,

i want that HNS plugin which works like this ,

If any ct knife any terriost 1 time(Because in 2 time t's will be killed) he will be slowed for X seconds ,

Thanks In Advance .

Last edited by NEXO.; 04-08-2019 at 09:06.
NEXO. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-09-2019 , 15:41   Re: [Request] HNS Slow After Dealing Damage
Reply With Quote #2

here you go...
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define PLUGIN "HnS ~ Knife Knockback"
#define VERSION "1.0"
#define AUTHOR "Natsheh"

#define TASK___ 876783

new g__cvar_oneg__cvar_twoFloat:g__fOldspeed[33];

const 
m_pPlayer 41;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_TakeDamage"player""fw_player_takedmg_post"1);
    
    new 
szItem[32], szWeaponName[32];
    for(new 
CSW_P228<= CSW_P90i++)
    {
        
get_weaponname(iszWeaponNamecharsmax(szWeaponName));
        if(!
equal(szWeaponName"weapon_"7)) continue;
        
RegisterHam(Ham_CS_Item_GetMaxSpeedszWeaponName"fw_CS_ItemGetMaxSpeed_pre");
    }
    
    
g__cvar_one register_cvar("hns_kkback_slow_length""2");
    
g__cvar_two register_cvar("hns_kkback_slowdown_maxspeed""200");
}

public 
fw_CS_ItemGetMaxSpeed_pre(ent)
{
    if(
g__fOldspeed[get_pdata_cbase(ent,m_pPlayer,4)] <= 0.0) return HAM_IGNORED;
    
    
SetHamReturnFloat(max(get_pcvar_float(g__cvar_two), -1.0))
    return 
HAM_SUPERCEDE;
}

public 
fw_player_takedmg_post(victiminflictorattackerFloat:fDamagedmgbits)
{
    if(!
is_user_alive(victim) || inflictor != attacker || !is_user_alive(attacker) || fDamage <= 0.0 || task_exists(TASK___+victim))
    {
        return;
    }
    
    static 
Float:fTime;
    
g__fOldspeed[victim] = get_user_maxspeed(victim);
    
set_user_maxspeed(victimmax(get_pcvar_float(g__cvar_two), -1.0));
    
set_task((fTime=floatmax(get_pcvar_float(g__cvar_one), 0.0)), "task_reset_maxspeed"TASK___+victim);
}

public 
task_reset_maxspeed(taskid)
{
    new 
id taskid TASK___;
    
    if(
is_user_alive(id))
    {
        
set_user_maxspeed(idg__fOldSpeed[id]);
    }
    
    
remove_task(taskid);
    
g__fOldspeed[id] = 0.0;

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-09-2019 at 15:44.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 15:38.


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