Time::setClockDate: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{ClientsideJsFunction}}
{{JSContainer|


==Syntax==
=== Summary ===
<syntaxhighlight lang="javascript">mp.game.time.setClockDate(day, month, year);</syntaxhighlight>
Sets the in-game date by specifying the day, month, and year. This function is useful for synchronizing the game environment with custom timelines or events.
=== Required Arguments ===
 
*'''day:''' int
=== Syntax ===
*'''month:''' int
*'''year:''' int
===Return value===
*'''Undefined'''
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
mp.game.time.setClockDate(day, month, year);
</syntaxhighlight>
</syntaxhighlight>
==See also==
 
{{Time_s_function_c}}
=== Required Parameters ===
* '''day:''' {{RageType|int}} - The day of the month (1–31).
* '''month:''' {{RageType|int}} - The month (1–12).
* '''year:''' {{RageType|int}} - The year to set.
 
=== Return Value ===
* '''undefined''' - No value is returned.
 
=== Example ===
This example sets the in-game date to January 1st, 2025:
<syntaxhighlight lang="javascript">
mp.game.time.setClockDate(1, 1, 2025);
mp.gui.chat.push("The in-game date has been updated to 01/01/2025.");
</syntaxhighlight>
}}
 
== See Also ==
{{Time_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:Time API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 12:42, 10 December 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Summary

Sets the in-game date by specifying the day, month, and year. This function is useful for synchronizing the game environment with custom timelines or events.

Syntax

mp.game.time.setClockDate(day, month, year);

Required Parameters

  • day: int - The day of the month (1–31).
  • month: int - The month (1–12).
  • year: int - The year to set.

Return Value

  • undefined - No value is returned.

Example

This example sets the in-game date to January 1st, 2025:

mp.game.time.setClockDate(1, 1, 2025);
mp.gui.chat.push("The in-game date has been updated to 01/01/2025.");


See Also