setDate: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>") |
||
Line 37: | Line 37: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <code> | |x1= <code>setDate [1986, 2, 25, 16, 0]; {{cc|4:00pm February 25, 1986}}</code> | ||
|x2= <code>{{cc|Set the real date (MP only):}}{{cc|postInit {{=}} 1;}} | |x2= <code>{{cc|Set the real date (MP only):}}{{cc|postInit {{=}} 1;}} | ||
Line 72: | Line 72: | ||
<dd class="note"> | <dd class="note"> | ||
Regarding execution in the middle of a session, the post of [[User:MulleDK13|MulleDK13]] is not entirely true. If you don't change the year, you are perfectly fine when executing the command on the server only. However, the server does not sync the year. Hence, if you do change the year, you have to execute the command on the server, clients and JIP to account for the missing sync. e.g. | Regarding execution in the middle of a session, the post of [[User:MulleDK13|MulleDK13]] is not entirely true. If you don't change the year, you are perfectly fine when executing the command on the server only. However, the server does not sync the year. Hence, if you do change the year, you have to execute the command on the server, clients and JIP to account for the missing sync. e.g. | ||
<code>[[], { | <code>[[], {setDate [1986, 2, 25, 16, 0]}] [[remoteExec]] ["[[call]]",0,"JIP_id_setDate"];</code> | ||
</dd> | </dd> | ||
</dl> | </dl> |
Revision as of 11:14, 12 May 2022
Description
- Description:
- Sets mission date and time. Players joining after mission start will get the current server date including the year.
- Multiplayer:
- Groups:
- Mission InformationEnvironment
Syntax
- Syntax:
- setDate date
- Parameters:
- date: Date - format [year, month, day, hour, minute]
- Return Value:
- Nothing
Examples
- Example 1:
setDate [1986, 2, 25, 16, 0]; // 4:00pm February 25, 1986
- Example 2:
// Set the real date (MP only):// postInit = 1; if (isServer) then { waitUntil {time > 0}; [missionStart select [0,5]] remoteExec ["setDate"]; };
Additional Information
- See also:
- date skipTime numberToDate dateToNumber
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- 10:00, 7/12/2010 (BST)
- Alpha
- This command sets the date for the southern hemisphere only, i.e. when the map is in northern hemisphere a date [2010,12,7,17,0] is in day light and and date [2010,6,7,17,0] is in darkness.
- 21:35, 31 October 2011 (EET)
- Osmo
- In multiplayer, the effect of this command is local, not global. The date from the server is synchronized with clients when they join the game (including start of the mission and joining in progress). E.g. if this command is executed on server in the init.sqf before the mission starts, every client will be synchronized with server as mission is started. However, if you run this command in the middle of the mission, effect is local.
- Posted on October 4, 2014 - 17:43 (UTC)
- MulleDK13
- Since an unknown version of Arma 3, this command now has global effect when executed on the server.
- Posted on April 23, 2017 - 02:58 (UTC)
- OOKexOo
-
Regarding execution in the middle of a session, the post of MulleDK13 is not entirely true. If you don't change the year, you are perfectly fine when executing the command on the server only. However, the server does not sync the year. Hence, if you do change the year, you have to execute the command on the server, clients and JIP to account for the missing sync. e.g.
[[], {setDate [1986, 2, 25, 16, 0]}] remoteExec ["call",0,"JIP_id_setDate"];
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Elite version 1.00
- Operation Flashpoint: Elite: New Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Mission Information
- Command Group: Environment
- Scripting Commands: Local Effect