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

Solved [ H3LP ] v_ model body delay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-04-2018 , 22:03   [ H3LP ] v_ model body delay
Reply With Quote #1

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); }
__________________









Last edited by CrazY.; 07-05-2018 at 10:54.
CrazY. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-05-2018 , 01:01   Re: [ H3LP ] v_ model body delay
Reply With Quote #2

What you see is most likely client prediction. For knife it happens only in Deploy.
You have to mess with UpdateClientData to fix it.
__________________

Last edited by HamletEagle; 07-05-2018 at 01:03.
HamletEagle is offline
Old 07-05-2018, 04:39
Ghosted
This message has been deleted by Ghosted. Reason: Wrongy
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-05-2018 , 08:01   Re: [ H3LP ] v_ model body delay
Reply With Quote #3

Use CurWeapon rather than setting tasks.
__________________

Last edited by OciXCrom; 07-05-2018 at 08:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-05-2018 , 09:32   Re: [ H3LP ] v_ model body delay
Reply With Quote #4

Check this one out
https://forums.alliedmods.net/showthread.php?t=305150
__________________
My plugin:
Celena Luna is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-05-2018 , 10:53   Re: [ H3LP ] v_ model body delay
Reply With Quote #5

Thanks for the sharing @Celena Luna, now it's working perfectly.

Spoiler
__________________









Last edited by CrazY.; 07-05-2018 at 10:54.
CrazY. is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-05-2018 , 12:04   Re: [ H3LP ] v_ model body delay
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Use CurWeapon rather than setting tasks.
I though he wanted something about Delay.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-14-2018 , 15:11   Re: [ H3LP ] v_ model body delay
Reply With Quote #7

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.
__________________
My plugin:
Celena Luna is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-14-2018 , 17:33   Re: [ H3LP ] v_ model body delay
Reply With Quote #8

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);
__________________









Last edited by CrazY.; 07-14-2018 at 17:34.
CrazY. 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 23:16.


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