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

[CS:GO] Detect if a player can't move because of freeze time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 07-04-2021 , 09:25   [CS:GO] Detect if a player can't move because of freeze time
Reply With Quote #1

I'm trying to identify if a player can't move because of freeze time. For some reasons I can't use round state, so instead I want to get a "flag" or a variable wich blocks player movement during freeze time.
I tried to check if m_fFlags is FL_FROZEN and if m_MoveType is not MOVETYPE_WALK, but both variables are not affected by freeze time. Is there any other datamap or netprop which I could use to detect that a particular player can't move because of freeze time?
kadet.89 is offline
Send a message via Skype™ to kadet.89
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-04-2021 , 09:44   Re: [CS:GO] Detect if a player can't move because of freeze time
Reply With Quote #2

Have you try look events like round_start -> round_freeze_end ?

or gamerules : m_bFreezePeriod ?

Last edited by Bacardi; 07-04-2021 at 09:45.
Bacardi is offline
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 07-04-2021 , 09:57   Re: [CS:GO] Detect if a player can't move because of freeze time
Reply With Quote #3

Thanks for your advice, round_freeze_end should work. I will use it if I don't find something more reliable.
I need to implement the same algorithm in an extension and getting m_bFreezePeriod would be too complicated for such a small feature.
For round_freeze_end my concern is that if the plugin or the extension is started in the middle of the round it is hard to tell whether freeze time ended or not.
I think there might be a datamap variable which is set to false for the freeze time period and blocks player movement.

UPD now I see that it's regulated by CCSPlayer::CanMove( and there is now datamap/netprop variable

Last edited by kadet.89; 07-04-2021 at 10:07.
kadet.89 is offline
Send a message via Skype™ to kadet.89
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 07-07-2021 , 06:16   Re: [CS:GO] Detect if a player can't move because of freeze time
Reply With Quote #4

You can also create a timer based on the freezetime @ round_start. Set a bool to true when round starts and set the bool to false when the timer ends. Therefore, you'll know when he's in freezetime or not.

Not the most effective way. Also as Bacardi said, round_freeze_end would also tell you when the freezetime ends.
__________________
SpirT is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-07-2021 , 07:07   Re: [CS:GO] Detect if a player can't move because of freeze time
Reply With Quote #5

in gamerules, there is m_bFreezePeriod variable...
__________________
Do not Private Message @me
Bacardi is offline
Reply


Thread Tools
Display Modes

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 13:06.


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