View Single Post
Author Message
Küspert
SourceMod Donor
Join Date: Aug 2006
Location: Germany
Old 02-26-2009 , 16:58   [CS:S] Source Cronjobs (SCJ)
Reply With Quote #1

Hi,

I know there are several plugins that add an cron-like functionality to the srcds, but in the past I started the code and now I finished it.

Also it's a bit different to the other plugins.

So SCJ offers 3 types of cronjobs:
  • round <-- every x rounds the given command is executed
  • period <-- after the specific period the command is executed
  • time <-- at this specific moment the task will be triggered
The configuration file is based an on keyvalues file and looks like this:

Code:
"Source Cronjobs"
{
    "1"
    {
        "type"                "round"
        "value"                "2"
        "task"                "say ROUND!"
    }    
    "2"
    {
        "type"                "time"
        "value"                "17:25"
        "task"                "say TIME!"
    }
    "3"
    {
        "type"                "period"
        "value"                "60.5"
        "task"                "say PERIOD!"
    }    
}
Also be aware of the format of the time and period time! The time has to be given in this syntax:

Code:
HH:MM
And the period value has to be a floating value, also explained in the config file!

Code:
// Important notes for YOU!
//
// Not for me 'cause I actually know what I've coded ;)
//
// You are allowd to use 3 types:
//
//    * 1st:        round        after x rounds (defined in "value" key) the task is executed. The value types has to be unique!
//    * 2nd:        period        after x seconds (defined in the "value" key) the task is executed. Value has to be a float!
//    * 3rd:        time        at this time (defined in the "value" key) the task will be executed (24 hour style. From 00:00 to 23:59).
//
// Multiple commands can be seperated with a ";"
Information:
  • Current stable version: 1.0.0
  • Current test version: N/A
Bugs:
  • If you want to report bugs use this thread or (better in my opinion) use my bugtracker (you have to register) at: http://mantis.srcds.net
  • Please give enough information to help to solve this problem!
  • Thanks
Changelog:
  • Currently NONE!
Planned features:
  • You can also see @ http://mantis.srcds.net

  • Version 1.1.0:

    • Command to trigger an "recompiling" of the cronjobs file
    • Creation of "one time" cronjobs
Folder structure:
  • sourcecronjobs.smx --> /addons/sourcemod/plugins/
  • sourcecronjobs.sp --> /addons/sourcemod/scripting/
  • sourcecronjobs.txt --> /addons/sourcemod/config/
  • sourcecronjobs.cfg --> /cfg/sourcemod/
Hope you like the plugin!

Cya
Attached Files
File Type: sp Get Plugin or Get Source (sourcecronjobs.sp - 1565 views - 11.9 KB)
File Type: zip Source_Cronjobs_20090226_225636.zip (11.5 KB, 1017 views)

Last edited by Küspert; 02-28-2009 at 04:18.
Küspert is offline
Send a message via ICQ to Küspert