AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [ H3LP ] v_ model body delay (https://forums.alliedmods.net/showthread.php?t=308825)

CrazY. 07-04-2018 22:03

[ H3LP ] v_ model body delay
 
Hello, I'm trying to set a custom sub-model in player view model, more specifically in the knife v_ model. My code it's working, but with a little bug in deploy event. Aparently is there a delay, so if I deploy, only after few seconds the body is changed.

I can share my model if you need it.

Code:
#include <amxmodx> #include <reapi> #include <hamsandwich> #include <fakemeta> public plugin_init() {     register_plugin("Cloak Test", "1.0", "Crazy");     RegisterHam(Ham_Item_Deploy, "weapon_knife", "CKnife_Deploy"),         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_Deploy(this) {     set_entvar(this, var_body, 1); }

HamletEagle 07-05-2018 01:01

Re: [ H3LP ] v_ model body delay
 
What you see is most likely client prediction. For knife it happens only in Deploy.
You have to mess with UpdateClientData to fix it.

OciXCrom 07-05-2018 08:01

Re: [ H3LP ] v_ model body delay
 
Use CurWeapon rather than setting tasks.

Celena Luna 07-05-2018 09:32

Re: [ H3LP ] v_ model body delay
 
Check this one out
https://forums.alliedmods.net/showthread.php?t=305150

CrazY. 07-05-2018 10:53

Re: [ H3LP ] v_ model body delay
 
Thanks for the sharing @Celena Luna, now it's working perfectly.

Spoiler

Ghosted 07-05-2018 12:04

Re: [ H3LP ] v_ model body delay
 
Quote:

Originally Posted by OciXCrom (Post 2601125)
Use CurWeapon rather than setting tasks.

I though he wanted something about Delay.

Celena Luna 07-14-2018 15:11

Re: [ H3LP ] v_ model body delay
 
Sorry for bump this up.
Sometime I got freeze at IDLE ANIM with the first submodel while switching weapon. Just asking if you got the same problem and if you can fix it.

CrazY. 07-14-2018 17:33

Re: [ H3LP ] v_ model body delay
 
Yes I've seen this problem. To fix it I believe you just need to increase the time of m_flLastEventCheck.

Code:
// Test with values biggest than 0.04; set_member(this, m_flLastEventCheck, get_gametime() + 0.04);


All times are GMT -4. The time now is 12:15.

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