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

Show Time!


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-10-2015 , 09:29   Re: Show Time!
Reply With Quote #11

CS binary is the same as CZ binary. Just stuffs for CZ are locked for CS. In case of TaskTime, it will be executed only if client finds an interface which CZ Singleplayer loads. So, probably impossible to do something from server.
__________________
Arkshine is offline
doondook
Member
Join Date: Dec 2010
Old 02-10-2015 , 09:31   Re: Show Time!
Reply With Quote #12

It was part of another plugin, just decided to quickly separate it. I was curious, if it needs anyone or not. Obviously, that not the most proper methods are used. I'll clean description and code then.

Last edited by doondook; 02-10-2015 at 09:32.
doondook is offline
doondook
Member
Join Date: Dec 2010
Old 02-11-2015 , 04:53   Re: Show Time!
Reply With Quote #13

Quote:
Originally Posted by Arkshine View Post
@doondook:

You should said clearly it requires a third-party module for <1.8.2 users.

- Parsing file each time a client connects is likely not a good idea, cache datas. A Trie seems appropriate.
- For permanent task, this would be recommended to use either one task with "b" flag (insertion is slow) or better create an entity to play timer's role (more precise).
- Is it really necessary to retrieve each time server time instead of adding +0.5? Using an entity as timer, this should be enough precise.
- Cleanup your code, you don't use *UserAlive.

This is really too bad we can't provide a negative number and RoundTime would increase time.
Updated.

I believe that I did not misunderstand your suggestion about using entity. Check it out, please.
And I see 1 disadvantage in using timer instead of retrieving server time (not critical). If a server or plugin is paused, the plugin won't continue its work. I can handle plugin pause/unpause events and use get_time() there again, but I haven't found any information about hooking server pause/unpause event. And also it's related to entity vs task. I will need to force entity think on unpause, whereas task will continue working by itself.
doondook is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-11-2015 , 05:29   Re: Show Time!
Reply With Quote #14

For [un]pause, you have 2 forwards: plugin_pause() and plugin_unpause(). It's easy to find: http://www.amxmodx.org/api/ and just type "pause".

About your last concern, I'm not to understand the issue.
__________________
Arkshine is offline
doondook
Member
Join Date: Dec 2010
Old 02-11-2015 , 06:05   Re: Show Time!
Reply With Quote #15

As I said:
Quote:
Originally Posted by doondook
I can handle plugin pause/unpause events and use get_time() there again, but I haven't found any information about hooking server pause/unpause event.
I mean these forwards do not handle server pause events (no idea why).

Since I didn't find a way to hook server pause events, task will be more useful. Because task will automatically executed again after unpause, but entity think won't.
doondook is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 02-11-2015 , 06:39   Re: Show Time!
Reply With Quote #16

Quote:
Originally Posted by doondook View Post
As I said:

I mean these forwards do not handle server pause events (no idea why).

Since I didn't find a way to hook server pause events, task will be more useful. Because task will automatically executed again after unpause, but entity think won't.
Have you read what arkshine said?
There are 2 forwards in amxx that allows you to hook pause/unpause

public plugin_pause()
{
// blablabla
}

public plugin_unpause()
{
// blablabla
}

They are forwards, like plugin_init, plugin_precache or client_connect for example, but without index.
__________________
Jhob94 is offline
doondook
Member
Join Date: Dec 2010
Old 02-11-2015 , 07:54   Re: Show Time!
Reply With Quote #17

I will repeat it 3rd time. For you.

plugin_pause() and plugin_unpause() forwards handle "plugin pause" events, commonly from pausecfg.sma:
PHP Code:
register_concmd("amx_pausecfg""cmdPlugin"ADMIN_CFG"- list commands for pause/unpause management")
    
register_clcmd("amx_pausecfgmenu""cmdMenu"ADMIN_CFG"- pause/unpause plugins with menu")
#if defined DIRECT_ONOFF
    
register_concmd("amx_off""cmdOFF"ADMIN_CFG"- pauses some plugins")
    
register_concmd("amx_on""cmdON"ADMIN_CFG"- unpauses some plugins")
#endif 
But they don't handle "server pause" event, commonly from admincmd.sma:
PHP Code:
register_concmd("amx_pause""cmdPause"ADMIN_CVAR"- pause or unpause the game"

Last edited by doondook; 02-11-2015 at 07:57.
doondook is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-11-2015 , 08:06   Re: Show Time!
Reply With Quote #18

Is there really admin having "pausable" to 1, so anyone can pause game when they feel to do it? lol

That's said, like I said, a task is fine too, it will just less precise.
__________________

Last edited by Arkshine; 02-11-2015 at 08:12.
Arkshine is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 02-17-2015 , 08:22   Re: Show Time!
Reply With Quote #19

Hi doondook, sorry for off-topic but can you give me your soccerjam multi-ball plugin
Thanks in advance.
Kz1.0 is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-24-2015 , 08:51   Re: Show Time!
Reply With Quote #20

Try to figure out how the game pauses the timer when you pause the server, perhaps you can trick the server timer into thinking the server is paused. I'm not sure if it is possible but if it is, that would be much better than sending a roundtime message several times a second.
PartialCloning 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 02:54.


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