Randomness Posted January 22, 2014 Report Share Posted January 22, 2014 It's just a minor modification to the examples of maca but I changed my event checks like this: //Checks before starting an event if (isNil "EPOCH_EVENT_RUNNING") then { EPOCH_EVENT_RUNNING = 0; }; if (isNil "MAX_EPOCH_EVENTS") then { MAX_EPOCH_RUNNING = 5; }; // Check if there are too many events running if ((!_debug) and {EPOCH_EVENT_RUNNING > MAX_EPOCH_EVENTS}) exitWith { diag_log format ["Already %1 active events",MAX_EPOCH_EVENTS]; }; EPOCH_EVENT_RUNNING = EPOCH_EVENT_RUNNING + 1; //EventHappening here //AT bottom: EPOCH_EVENT_RUNNING = EPOCH_EVENT_RUNNING - 1; It's not much, but if you want to have several custom events running at the same time, but never more than a set ammount, this might be a good help for you :) Link to comment Share on other sites More sharing options...
cayote Posted January 25, 2014 Report Share Posted January 25, 2014 Looks cool but I don't know enough about the scripting. Where would 'MAX_EPOCH_EVENTS' be set? Link to comment Share on other sites More sharing options...
Randomness Posted January 25, 2014 Author Report Share Posted January 25, 2014 WHere you set all the other epoch variables too Link to comment Share on other sites More sharing options...
El Gobernador Posted January 28, 2014 Report Share Posted January 28, 2014 Please I want to know if I'm doing well, thanks Look for: if (isNil "EPOCH_EVENT_RUNNING") then { EPOCH_EVENT_RUNNING = false; }; Remplace to: if (isNil "EPOCH_EVENT_RUNNING") then { EPOCH_EVENT_RUNNING = 0; }; if (isNil "MAX_EPOCH_EVENTS") then { EPOCH_EVENT_RUNNING = 5; }; Look for: // Check for another event running if (EPOCH_EVENT_RUNNING) exitWith { diag_log("Event already running"); }; Remplace to: // Check if there are too many events running if (EPOCH_EVENT_RUNNING > MAX_EPOCH_EVENTS and !_debug) exitWith { diag_log format ["Already %1 active events",MAX_EPOCH_EVENTS]; }; EPOCH_EVENT_RUNNING = EPOCH_EVENT_RUNNING + 1; if (isNil "MAX_EPOCH_EVENTS") then { EPOCH_EVENT_RUNNING = 5; }; And finally add in the end this: //AT bottom: EPOCH_EVENT_RUNNING = EPOCH_EVENT_RUNNING - 1; Link to comment Share on other sites More sharing options...
Randomness Posted January 29, 2014 Author Report Share Posted January 29, 2014 Sorry seems i made a little mistake there: This: if (isNil "MAX_EPOCH_EVENTS") then { EPOCH_EVENT_RUNNING = 5; }; should be if (isNil "MAX_EPOCH_EVENTS") then { MAX_EPOCH_EVENTS = 5; }; Link to comment Share on other sites More sharing options...
dgrayman2008 Posted August 11, 2015 Report Share Posted August 11, 2015 Hello I seem to be getitng some errors. But I am getting multiple events at once so not sure what these errors mean 23:28:07 "RUNNING EVENT: Treasure on [2015,8,10,13,28]" 23:28:07 Error in expression < if ((!_debug) and {EPOCH_EVENT_RUNNING > MAX_EPOCH_EVENTS}) exitWith { diag_log> 23:28:07 Error position: <> MAX_EPOCH_EVENTS}) exitWith { diag_log> 23:28:07 Error >: Type Bool, expected Number 23:28:07 File z\addons\dayz_server\modules\Treasure.sqf, line 79 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now