GetPlayerTime

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 20:38, 16 August 2016
Whiteghost (Talk | contribs)

← Previous diff
Current revision
OstGot (Talk | contribs)

Line 8: Line 8:
{{Param|&minute|A variable in which to store the minutes, passed by reference.}} {{Param|&minute|A variable in which to store the minutes, passed by reference.}}
-{{ReturnsSuccess||The player specified does not exist.}}+{{ReturnsSuccess||The player specified does not exist.
 +* The current game time is stored in the specified variables.}}
{{Example}} {{Example}}

Current revision



Description:

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


Parameters:
(playerid, &hour, &minute)
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.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. The player specified does not exist.
  • The current game time is stored in the specified variables.


Example Usage:

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

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools