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

Safe way to check the server is in pause


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 03-31-2020 , 23:35   Safe way to check the server is in pause
Reply With Quote #1

Hi, I'm wondering if there is a realiable way to check if the server is in pause, because for me isn't enough to create a global variable where I save everytime server is in pause (this is the way amx_pause does), and also this system breaks when other plugin or someone unpauses the server without using amx_pause.

PD: I was thinking in checking get_gametime(), if it returns the same twice, it means the server is in pause, but i dont know
__________________

Last edited by rtxa; 04-02-2020 at 13:05.
rtxa is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-01-2020 , 11:03   Re: Reliable way to check if server is in pause
Reply With Quote #2

that could work i guess, depends how you wanna do it.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 04-02-2020 , 13:08   Re: Reliable way to check if server is in pause
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
that could work i guess, depends how you wanna do it.
Yeah, the problem with this is you need to find a function that executes when server is in pause to do those checks, because set_task() will not work, neither server_frame(). I found only one function that executes even in pause that you can hook with Fakemeta, "FM_AllowLagCompensation". It only works when there are players connected.

But even using that function, it didn't work well to check if gametime is the same, i'm doing something wrong for sure, any ideas?

I don't know, if someone finds a nice and simple solution, maybe it can be implement in amx_pause
__________________

Last edited by rtxa; 04-02-2020 at 13:13.
rtxa is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-03-2020 , 07:13   Re: Safe way to check the server is in pause
Reply With Quote #4

Have u tried hooking amx_pause itself? Save gametime when amx_pause is triggered and save gametime when amx_unpause is triggered. Check these 2 values?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
rtxa
Senior Member
Join Date: Mar 2018
Location: Argentina
Old 04-08-2020 , 22:58   Re: Safe way to check the server is in pause
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
Have u tried hooking amx_pause itself? Save gametime when amx_pause is triggered and save gametime when amx_unpause is triggered. Check these 2 values?
That's the problem, that method isn't realiable, maybe another plugin pause the server not using this way, etc. Whatever, I will come with a solution and I will post it here
__________________
rtxa 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 19:46.


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