[Release] Player total online time counter - FILE or SQL SAVE

No i didn’t do that… search me a wulf and find no help… it runs but i ve the error:

Error running system event handling function for resource onlinetime_sql_V2: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server.lua:74: attempt to index a nil value (field ‘?’)
stack traceback:
server.lua:74: in upvalue ‘handler’
citizen:/scripting/lua/scheduler.lua:175: in function citizen:/scripting/lua/scheduler.lua:174
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:41: in field ‘CreateThreadNow’
citizen:/scripting/lua/scheduler.lua:174: in function citizen:/scripting/lua/scheduler.lua:138

Maybe @Cheleber no what the error means and how i can fix it?

Server.lua line 74 is where the issue is…

@FAXES here the part of the scheduler.lua and line 74 is marked https://hastebin.com/umunilucoc.lua can you see an error, pls?

You solved your problem @NebelRebell?

No, sorry its the same error all the time. but server stabil and do not crash. If i stop the script we ve no errors…and its only if one joins on the server.

is there a way to make that show up on the screen and not the chat

Having the same error as @NebelRebell Simple server restart fixes it but comes back after a while.

I’m on it, its in front of my eyes but i can’t see it…butI will found it and share

[ERROR] [MySQL] An error happens on MySQL for query “SELECT * FROM times WHERE identifier=@id {@id=stea m:1100001119ca73d}”: Access denied for user ‘root’@‘localhost’ (using password: NO)
what can i do?

Delete the script, it’s not working stress free. #nojoke

Well how do they make it work?

I test it before month, wrote the scripter, found no way. maybe it works not with esx, what ever. Sorry I can’t help

Still not working, no aswer, no help. Can not recommend this script definitely

@Cheleber The script works perfect except none of the tables on the My-SQL database update… they just stay blank. Everything client side e.g. the chat commands etc, works perfect!

this is my server.cfg connection string

set mysql_connection_string “server=localhost;uid=root;password=;database=users”

Heres my database

It works perfect here

Would you be able to Show me either your database or the connection string on your server.cfg?

Would be greatly appreciated!



Are you following the error logs to identify your issue?

How would I go about making it so the Identifier is ID (or player name) instead of the steam identifier?

Not to good with SQL so help would be appreciated!

[ERROR] [MySQL] [onlinetime_sql] An error happens on MySQL for query “[object Ob
ject]”: ER_BAD_NULL_ERROR: Column ‘identifier’ cannot be null
Error: (node:7388) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTI
ON]: unexpected PromiseRejectEvent
at process. (internal/process/promises.js:27:25)
at
at Query.db.query [as _callback] (mysql-async.js:4973:13)
at Query.Sequence.end (mysql-async.js:280:24)
at Query.ErrorPacket (mysql-async.js:2122:8)
at Protocol._parsePacket (mysql-async.js:5941:23)
at Parser.write (mysql-async.js:6198:12)
at Protocol.write (mysql-async.js:5701:16)
at Socket. (mysql-async.js:693:28)
at emitOne (events.js:116:13)
Error: (node:7388) UnhandledPromiseRejectionWarning: Unhandled promise rejection
. This error originated either by throwing inside of an async function without a
catch block, or by rejecting a promise which was not handled with .catch(). (re
jection id: 35)
Error: (node:7388) UnhandledPromiseRejectionWarning: Error: ER_BAD_NULL_ERROR: C
olumn ‘identifier’ cannot be null
at Query.Sequence._packetToError (mysql-async.js:244:14)
at Query.ErrorPacket (mysql-async.js:2109:18)
at Protocol._parsePacket (mysql-async.js:5941:23)
at Parser.write (mysql-async.js:6198:12)
at Protocol.write (mysql-async.js:5701:16)
at Socket. (mysql-async.js:693:28)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
--------------------
at Pool.query (mysql-async.js:4728:23)
at Promise (mysql-async.js:4970:12)
at new Promise ()
at execute (mysql-async.js:4967:26)
at Object.global.exports [as callback] (mysql-async.js:4985:5)
at citizen:/scripting/v8/main.js:87:41
at citizen:/scripting/v8/main.js:51:18
at setImmediate (mysql-async.js:4962:9)
at Object.callback (citizen:/scripting/v8/timer.js:96:21)
at onTick (citizen:/scripting/v8/timer.js:121:27)
Error: (node:7388) UnhandledPromiseRejectionWarning: Unhandled promise rejection
. This error originated either by throwing inside of an async function without a
catch block, or by rejecting a promise which was not handled with .catch(). (re
jection id: 36)

I found a problem Thank you for sharing information.