GetPlayerTimeOnline
Docslocal retval = GetPlayerTimeOnline(playerSrc)Description
Gets the current time online for a specified player.
Parameters
| Name | Type | Description |
|---|---|---|
playerSrc | char* | A player. |
Returns
intReturns an integer value.
Examples
Official
local function ShowTimeOnline()
local player = source
local secondsTotalOnline = GetPlayerTimeOnline(player)
print(("Time online : %f H %f min %f"):format(
(secondsTotalOnline / 3600),
((secondsTotalOnline / 60) % 60),
(secondsTotalOnline % 60)
))
end
RegisterNetEvent("myTimeOnline", ShowTimeOnline)