just a simple script that store onlinetime and custom time that you want easier.
Online Time Tracker
Exports for easy access
API Reference [Serverside]
Get time record without plus from database (airtime).
exports [' errorism.time' ]:getCurrent (index ,identifier )
Parameter
Type
Description
index
string
Required . Index of time record
identifier
string
Required . Identifier of player
exports [' errorism.time' ]:get (index ,identifier ,onDatabase )
Parameter
Type
Description
index
string
Required . Index of time record
identifier
string
Required . Identifier of player
onDatabase
boolean
Plus time from database
Start custom time record.
exports [' errorism.time' ]:start (index ,identifier )
Parameter
Type
Description
index
string
Required . Index of time record
identifier
string
Required . Identifier of player
Stop custom time record and return the result.
exports [' errorism.time' ]:stop (index ,identifier ,save )
Parameter
Type
Description
index
string
Required . Index of time record
identifier
string
Required . Identifier of player
save
boolean
Save on database?
return
int
Time result in milliseconds (airtime if not save)
local xPlayer = ESX .GetPlayerFromId (source )
local identifier = xPlayer .getIdentifier ()
local onlineTime = exports [' errorism.time' ]:get (' online' ,identifier ,true )
print (onlineTime )
-- Output : 123123
exports [' errorism.time' ]:start (' test' ,identifier )
Wait (3000 )
local time = exports [' errorism.time' ]:stop (' test' ,identifier ,true )
print (time )
-- Output : 3000
Server: lua