[Release] Player Logging - Log Those People That Get Away! [1.2]

Hey this doesnt work, just tried it.

Replying to somebody but quoting me, I’m confused. What doesn’t work?

@Scott_UK No I mean if you have the server setting to only steam users, the server when connecting would check that first before this script

At this stage no. mainly because SOME server owners will use it for other purposes. I do not want to take part in that or my scripts.

@TreyWoods @BabbaTundaee You should use somethhing like GetPlayerEP(source)

@zee Yeah I know, but I’m here to update that if it changes, which in my time it has not to my knowledge. But if it does I’ll update it…

Wait, i didn’t realize that until you said something, i meant to quote lucifer

1 Like

Thx you very much, like the idea, like the script, will test it!

1 Like

well it don’t seem to work this end

What do you mean?

1 Like

Hi, where does this save the logged info?

In a text file within the resource. You can also change it within the config. Change the config to

saveInResource = true

and if you want it somewhere custom change it to false and change the directory.

1 Like

Release 1.1

  • Added IP Logging
  • Added DiscordID Logging
  • Added new config options to disable log types.
  • Made minor adjustments

Downloads in OP

1 Like
Error parsing script server.lua in resource PlayerLogs: server.lua:45: 'then' expected near 'not' 
Failed to load script server.lua. 
Started resource PlayerLogs 

I changed it to:

    if identifierSteam == nil or not logSteamId then
        identifierSteam = "N/A"
    end
    if identifierRock == nil or not logRockId then
        identifierRock = "N/A"
    end
    if identifierDiscord == nil or not logDiscordId then
        identifierDiscord = "N/A"
    end
    if identifierIP == nil or not logSteamId then
        identifierIP = "N/A"
    end

Now the resource starts but getting this:

Error running system event handling function for resource PlayerLogs: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server.lua:24: attempt to index a nil value (global 'file') 
stack traceback: 
server.lua:24: in function 'writeLog' 
server.lua:55: in upvalue 'handler' 
citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218> 
stack traceback: 
[C]: in function 'error' 
citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow' 
citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182> 

I’ll push a fix for this within the next 30 mins

Fixed. Download from github. Not Direct

I do not know what happens, but I did everything right and I get this error:

Connecting: assasinglitche[0m
Error running system event handling function for resource PlayerLogs: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server.lua:24: attempt to index a nil value (global ‘file’)
stack traceback:
server.lua:24: in function ‘writeLog’
server.lua:55: in upvalue ‘handler’
citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218>
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:41: in field ‘CreateThreadNow’
citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182>

error in photo: https://gyazo.com/76ed1c01b76a9b1ad81865b3ecc2acce

I have created the file Player-Logs.txt where is server.cfg and I do not know what I can do so that it does not fail: /

Thanks :smiley:

It would create it if not found. Make sure the config is set up right. Also what server version you on? Use version in console if your not sure

I uploaded your fix:

Error running system event handling function for resource PlayerLogs: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: server.lua:24: attempt to index a nil value (global 'file') 
stack traceback: 
server.lua:24: in function 'writeLog' 
server.lua:55: in upvalue 'handler' 
citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218> 
stack traceback: 
[C]: in function 'error' 
citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow' 
citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182> 
"version" is "FXServer-feature/one-off-server-hotfix v1.0.0.958 linux" 
default: "FXServer-feature/one-off-server-hotfix v1.0.0.958 linux" 

So I installed it like any other normal resource, but how do I get it to work? Example when I leave/join, there’s no new files being created and or the server.lua got no info at all except for the codings and stuff…

Make sure its installed correct, make sure the config is set up.

This is all correct right? Or… am I missing something since you said “config” and I didn’t get any files named “config” when I installed it from GitHub…

image
image
image

1 Like

I did.

server.lu

fileName = "Player-Logs"
resourceDirectory = "resources/PlayerLogs/"
saveInResource = true

server.cfg

Folder name

Console telling me the resource is starting.

Started resource iplloader 
Started resource esx_jb_eden_garage 
Started resource jsfour-mdc 
Started resource jsfour-criminalrecord 
Started resource esx-checkdeathcause 
Started resource PlayerLogs 
Stopping resource sessionmanager 
Started resource sessionmanager 
Authenticating server license key... 
Server license key authentication succeeded. Welcome! 
cfx> Sending heartbeat to live-internal.fivem.net:30110 
Started map fivem-map-skater 
Started resource fivem-map-skater 

Same error