just a simple script that store onlinetime and custom time that you want easier.
- Online Time Tracker
- Exports for easy access
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 |
exports['errorism.time']:start(index,identifier)| Parameter | Type | Description |
|---|---|---|
index |
string |
Required. Index of time record |
identifier |
string |
Required. Identifier of player |
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 : 3000Server: lua
