Lewati ke konten utama

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

true - The function executed successfully.

false - The function failed to execute. The player specified does not exist.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/noon", true))
{
SetPlayerTime(playerid, 12, 0); // Noon
return 1;
}
if (!strcmp(cmdtext, "/midnight", true))
{
SetPlayerTime(playerid, 0, 0); // Midnight
return 1;
}
return 0;
}

Notes

peringatan

Using this function under OnPlayerConnect doesn't work.