AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Body bug v_ primaryattack (https://forums.alliedmods.net/showthread.php?t=317052)

batmanishere 06-23-2019 16:20

Body bug v_ primaryattack
 
Hello guys, i have a probleme, i use v_ with submodels(body) and is work ok but on fire(+attack) body is set to 2.I want your help to stop changing body on fire, i try with postframe+preframe+etc not work.. the same probleme
Probleme: https://im3.ezgif.com/tmp/ezgif-3-b31f001e2ea2.gif
Code:

#include <amxmodx>
#include <reapi>
#include <hamsandwich>
#include <fakemeta>

public plugin_init()
{
        register_plugin("Cloak Test", "1.0", "Crazy");

        RegisterHam(Ham_Item_Deploy, "weapon_m4a1", "CKnife_Deploy")
        RegisterHam(Ham_Item_PreFrame, "weapon_m4a1", "CKnife_Deploys")
        RegisterHam(Ham_Item_PostFrame, "weapon_m4a1", "CKnife_Deploys")
        register_forward(FM_CanSkipPlayer, "CBasePlayer_CanSkip");
}

public CBasePlayer_CanSkip(this)
{
        if (!is_user_alive(this))
                return FMRES_IGNORED;

        if (get_user_weapon(this) != CSW_KNIFE)
                return FMRES_IGNORED;

        forward_return(FMV_CELL, false);
        return FMRES_OVERRIDE;
}

public CKnife_Deploys(this)
{
        set_entvar(this, var_weaponanim, 0);
        set_entvar(this, var_body, 4);
        set_entvar(this, var_skin, 4);
        set_entvar(this, var_sequence, 0);
        set_entvar(get_pdata_cbase(this, 41, 4), var_weaponanim, 0);
}
public CKnife_Deploy(this)
{
        set_entvar(this, var_weaponanim, 0);
        set_entvar(this, var_body, 4);
        set_entvar(this, var_skin, 4);
        set_entvar(this, var_sequence, 0);
        set_entvar(get_pdata_cbase(this, 41, 4), var_weaponanim, 0);
}


CrazY. 06-24-2019 08:57

Re: Body bug v_ primaryattack
 
https://forums.alliedmods.net/showthread.php?t=287260
Btw, where do you downloaded that plugin?

iceeedr 06-24-2019 09:24

Re: Body bug v_ primaryattack
 
Quote:

Originally Posted by CrazY. (Post 2656565)
https://forums.alliedmods.net/showthread.php?t=287260
Btw, where do you downloaded that plugin?

https://dev-cs.ru/threads/3139/

HamletEagle 06-24-2019 14:02

Re: Body bug v_ primaryattack
 
For knife you can get better results, as knife doesn't have client prediction. However, it will glitch a bit on deploy, so all you have to do to fix this(and without causing any side effect) is to set CD_ID to 0(only when the active item is knife) in UpdateClientData.

batmanishere 06-25-2019 03:57

Re: Body bug v_ primaryattack
 
Quote:

Originally Posted by HamletEagle (Post 2656608)
For knife you can get better results, as knife doesn't have client prediction. However, it will glitch a bit on deploy, so all you have to do to fix this(and without causing any side effect) is to set CD_ID to 0(only when the active item is knife) in UpdateClientData.

And for the other weapons what you recomand me?Is ok this plugin https://forums.alliedmods.net/showthread.php?t=287260 / https://forums.alliedmods.net/showthread.php?t=287754 ?

HamletEagle 06-25-2019 05:39

Re: Body bug v_ primaryattack
 
For other weapons there is no good way. The idea is mainly the same, disable client prediction by setting CD_ID to 0, but you will have to recode some parts of the weapon and it will mess with hit registration when there is lag.


All times are GMT -4. The time now is 17:26.

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