Raised This Month: $32 Target: $400
 8% 

No hit slowdown on non zp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaBBa
Member
Join Date: Dec 2012
Old 02-20-2021 , 14:29   No hit slowdown on non zp
Reply With Quote #1

I want to disable weapon hit slowdown on non zombie mod.
I tried to remove zp components from this: https://forums.alliedmods.net/showthread.php?t=149249
But players still have slowdown when they are hurt, I want to completely remove slowdown on takedamage

edited version:

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

#include <hamsandwich>

/*================================================================================
 [Constants, Offsets, Macros]
=================================================================================*/

// Plugin Version
new const PLUGIN_VERSION[] = "1.1.0"

/*================================================================================
 [Global Variables]
=================================================================================*/

// Player vars
new Float:g_Knockback[33][3// velocity from your knockback position

// Game vars
new g_bHamCzBots // whether ham forwards are registered for CZ bots

// Cvar pointers
new cvar_BotQuota

/*================================================================================
 [Precache and Init]
=================================================================================*/

public plugin_precache()
{
    
register_plugin("[CSO] Addon: No Engine Knockback"PLUGIN_VERSION"schmurgel1983")
}

public 
plugin_init()
{
    
// HAM Forwards "player"
    
RegisterHam(Ham_TakeDamage"player""fwd_TakeDamage")
    
RegisterHam(Ham_TakeDamage"player""fwd_TakeDamage_Post"1)
    
    
cvar_BotQuota get_cvar_pointer("bot_quota")
    
register_cvar("NoEngineKnockback_version"PLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY)
    
set_cvar_string("NoEngineKnockback_version"PLUGIN_VERSION)
}


public 
client_putinserver(id)
{
    
// Cached bot stuff
    
if(is_user_bot(id))
    {
        
// CZ bots seem to use a different "classtype" for player entities
        // (or something like that) which needs to be hooked separately
        
if(!g_bHamCzBots && cvar_BotQuota)
        {
            
// Set a task to let the private data initialize
            
set_task(0.1"register_ham_czbots"id)
        }
    }
}

/*================================================================================
 [Main Forwards]
=================================================================================*/

// Ham Take Damage Forward
public fwd_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    
// Engine Knockback disabled
    
pev(victimpev_velocityg_Knockback[victim])
}

// Ham Take Damage Post Forward
public fwd_TakeDamage_Post(victim)
{
    
// Engine Knockback disabled
    
static Float:push[3]
    
pev(victimpev_velocitypush)
    
xs_vec_sub(pushg_Knockback[victim], push)
    
xs_vec_mul_scalar(push0.0push)
    
xs_vec_add(pushg_Knockback[victim], push)
    
set_pev(victimpev_velocitypush)
}

/*================================================================================
 [Other Functions]
=================================================================================*/

public register_ham_czbots(id)
{
    
// Make sure it's a CZ bot and it's still connected
    
if (g_bHamCzBots || !is_user_connected(id) || !get_pcvar_num(cvar_BotQuota)) return
    
    
RegisterHamFromEntity(Ham_TakeDamageid"fwd_TakeDamage")
    
RegisterHamFromEntity(Ham_TakeDamageid"fwd_TakeDamage_Post"1)
    
    
// Ham forwards for CZ bots succesfully registered
    
g_bHamCzBots true

__________________

Last edited by SaBBa; 02-22-2021 at 04:00.
SaBBa is offline
Old 02-21-2021, 19:44
SaBBa
This message has been deleted by SaBBa.
SaBBa
Member
Join Date: Dec 2012
Old 02-22-2021 , 04:00   Re: No hit slowdown on non zp
Reply With Quote #2

No one has solution for this?
__________________
SaBBa 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 17:03.


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