Skip to content

Instantly share code, notes, and snippets.

@iaretechnician
Created September 8, 2019 12:31
Show Gist options
  • Save iaretechnician/c9a94c65168859eb670599ea67aa762f to your computer and use it in GitHub Desktop.
Save iaretechnician/c9a94c65168859eb670599ea67aa762f to your computer and use it in GitHub Desktop.
Dayz scheduled messages
//array of messages.
// text,delay minutes,interval minutes
if (isserver)
{
_messages = [
["text message",10,15],
["text message",20,15],
["server will restart on the hour",100,5]
];
while(true) do {
{
sleep 15;
_servertime = serverTime;
_nextrun= _message select 1 * 60;
_interval = _message select 2 * 60;
_msg = _message select 0;
if (_nextrun < _servertime)
{
publicvariable sched_msg = _msg;
_message select 1 = _nextrun + _interval;
};
}foreach _message;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment