open.mp | GetPlayerTime
  • 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.

GetPlayerTime

Description

Get the player's current game time. Set by SetWorldTime, or by the game automatically if TogglePlayerClock is used.

NameDescription
playeridThe ID of the player to get the game time of.
&hourA variable in which to store the hour, passed by reference.
&minuteA variable in which to store the minutes, passed by reference.

Returns

1: The function was executed successfully.

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

The current game time is stored in the specified variables.

Examples

new hour, minutes;
GetPlayerTime(playerid, hour, minutes);
if (hour == 13 && minutes == 37)
{
    SendClientMessage(playerid, COLOR_WHITE, "The time is 13:37!");
}

Related Functions

  • SetPlayerTime: Set a player's time.
  • SetWorldTime: Set the global server time.
  • TogglePlayerClock: Toggle the clock in the top-right corner.

Community

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

More

  • SA-MP
  • Blog
  • GitHub