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

Server Tasks v2.0


Post New Thread Reply   
 
Thread Tools Display Modes
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 06-01-2012 , 23:13   Re: Server Tasks v1.1
Reply With Quote #31

Quote:
Originally Posted by Arkshine View Post
I agree with fysiks. You should consider it.

Some things :
  • Use trim() instead of replace().
  • strtok() + trim()² = parse().
  • Just check hFile one time after fopen() and remove the others checks.
  • Avoid the use of set_task() with "b" flag. Use an entity, see this tutorial.
  • In server_cmd(), you can use directly ArrayGetStringHandle() with "%a".
Alright. I don't really think to use an entity for this repetitive task. Think forward is executing very fast and very densely, for example, for each weapon_knife, et cetera, so it could take from the server's performance much enough.

It will be ready soon.

Code from Engine:

PHP Code:
void Think(edict_t *pent)
{
    
unsigned int i 0;
    const 
char *cls STRING(pent->v.classname);
    
META_RES res=MRES_IGNORED;
    
int retVal=0;
    for (
i=0i<Thinks.size(); i++)
    {
        if (
Thinks[i]->Class.compare(cls)==0)
        {
            
retVal=MF_ExecuteForward(Thinks[i]->Forward, (cell)ENTINDEX(pent));
            if (
retVal 2/*PLUGIN_HANDLED_MAIN*/)
                
RETURN_META(MRES_SUPERCEDE);
            else if (
retVal)
                
res=MRES_SUPERCEDE;
        }
    }
    
retVal=MF_ExecuteForward(pfnThinkForward, (cell)ENTINDEX(pent));
    if (
retVal)
        
res=MRES_SUPERCEDE;

    
RETURN_META(res);

__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 06-03-2012 , 12:06   Re: Server Tasks v1.2
Reply With Quote #32

Now plugin has been updated.
Were not made with an further entity due to performance.
If adding an entity is a strongly requirement I will do it but using FakeMeta or HamSandwich.
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-03-2012 , 13:08   Re: Server Tasks v1.2
Reply With Quote #33

Honestly, I'm not sure. Some people say set_task() lags their server, or Haw552 ; who knows what he's doing ; would not have done a tutorial about this matter and I would trust more his knowledge rather mine. Can you prove it ? ( "FakeMeta or HamSandwich", you can't be serious, pfnThink is used too, it would be worse since you would need to filter in the plugin). Looking at the code, for me, both are more or less the same. I guess it's ok as it is. Probably.

By the way, use charsmax() instead of writing each time - 1. Just a convenient existing define.

Don't use static in plugin_init.
__________________

Last edited by Arkshine; 06-03-2012 at 13:48.
Arkshine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 06-03-2012 , 15:20   Re: Server Tasks v1.2
Reply With Quote #34

That's it.

Updated at version 1.3
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-03-2012 , 16:07   Re: Server Tasks v1.3
Reply With Quote #35

Guess, it's enough good now.

Approved.
__________________
Arkshine is offline
vladllg
Junior Member
Join Date: Dec 2012
Location: Romania
Old 12-06-2012 , 04:41   Re: Server Tasks v1.3
Reply With Quote #36

How put in server_tasks.ini mp_timelimit 0?
__________________


Last edited by vladllg; 12-06-2012 at 04:42.
vladllg is offline
Send a message via Yahoo to vladllg
leonardo_
Member
Join Date: Nov 2012
Location: Moscow, right now in Vic
Old 04-30-2013 , 19:45   Re: Server Tasks v1.3
Reply With Quote #37

Quote:
Originally Posted by vladllg View Post
How put in server_tasks.ini mp_timelimit 0?
01:44 = mp_timelimit 0
__________________
www.Deagle-Shot.ru - Game Community

Last edited by leonardo_; 04-30-2013 at 19:45.
leonardo_ is offline
Send a message via ICQ to leonardo_ Send a message via Skype™ to leonardo_
1ka
Senior Member
Join Date: Jun 2012
Old 05-16-2013 , 00:31   Re: Server Tasks v1.3
Reply With Quote #38

Authors, please answer.

1.
I did before, I installed 24 hours, every 10 minutes functions,
So it was a lot of functions,
Because of the abundance continued to meet in an error log.
This improved?

2.
Also if I may add day?
For example:
"any_month" "10" "csstats_reset 1"
"any_month" "20" "csstats_reset 1"
"any_month" "28" "csstats_reset 1"
that the statistics restart every 10 days.
__________________
Sorry for my bad english.

Last edited by 1ka; 05-16-2013 at 01:19.
1ka is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 05-19-2013 , 18:48   Re: Server Tasks v1.3
Reply With Quote #39

Is time based on the timelimit of the map or its based on a 24 hour day?
Like if i put the below. The server will anounce this every 12 hours? Also what if the server crashes will the time reset? Or continue off from where it was? Like say i want the message every 12 hours and there is 20 minutes remaining for it to be annouce but than the server crashes. Will the message be displayed after 20 minutes or will the plugin make it wait the 12 hours again?

"12:00" "say hellow everybody"
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 03-09-2015 , 15:44   Re: Server Tasks v1.1
Reply With Quote #40

Quote:
Originally Posted by fysiks View Post
PHP Code:
    if( szTime] == '0' )
        
server_cmd"exec %s/ServerNight.cfg"szConfigsDir );
    
    else
        
server_cmd"exec %s/ServerDay.cfg"szConfigsDir ); 
This has nothing to do with this plugin and is a poor assumption of "day" and "night."
Updated to version 2.
Of course yes, this is true.
See changes log in the first message to learn what has been changed.

Quote:
Originally Posted by 1ka View Post
Authors, please answer.

1.
I did before, I installed 24 hours, every 10 minutes functions,
So it was a lot of functions,
Because of the abundance continued to meet in an error log.
This improved?

2.
Also if I may add day?
For example:
"any_month" "10" "csstats_reset 1"
"any_month" "20" "csstats_reset 1"
"any_month" "28" "csstats_reset 1"
that the statistics restart every 10 days.
I do not understand. Please try to re-explain or use Google Translate.
I will add support for year/ month/ day tasks in version 3 if that's what you mean.
__________________

Last edited by claudiuhks; 03-09-2015 at 15:49.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 11:49.


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