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:
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: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