RedM Index logoRedM Index
NativesHashesClothesBlipsPropsItem Tool
Sign inGet started

Reference

  • Natives
  • Hashes
  • Clothes
  • Blips
  • Props

Namespace

  1. Reference
  2. Natives
  3. GET_PLAYER_TIME_ONLINE

GET_PLAYER_TIME_ONLINE

Gets the current time online for a specified player.

CFX

Signature

lua
GetPlayerTimeOnline(playerSrc)
-- returns int

Parameters

NameTypeDescription
char*A player.

Usage

Named call
GetPlayerTimeOnline(playerSrc)
InvokeNative
Citizen.InvokeNative(0x67D2E605, playerSrc)
lua 1
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)

Details

Hash
API set
Source
cfx

Source: cfx

On this page

  • Signature
  • Parameters
  • Usage
  • Details