open.mp | SetPlayerTime
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文
warning Not Translated

This page has not been translated into the language that your browser requested. The English content is being shown as a fallback.

If you want to contribute a translation for this page then please click here.

SetPlayerTime

Description

Sets the game time for a player. If a player's clock is enabled (TogglePlayerClock) the time displayed by it will update automatically.

NameDescription
playeridThe ID of the player to set the game time of.
hourHour to set (0-23).
minuteMinutes to set (0-59).

Returns

1: The function executed successfully.

0: The function failed to execute. The player specified does not exist.

Examples

SetPlayerTime(playerid, 12, 0); // Noon
SetPlayerTime(playerid, 0, 0); // Midnight

Notes

tip

Using this function under OnPlayerConnect doesn't work.

Related Functions

  • SetWorldTime: Set the global server time.
  • GetPlayerTime: Get the time of a player.
  • TogglePlayerClock: Toggle the clock in the top-right corner.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub