About
Ever been in the process of banning someone, but as your typing in the command, they leave? Well, this just might help you. This simple script saves all people that connect to the server in a log. This logs their; game name, steam hex, game license key and it also adds a timestamp! This is a very basic script but its a great utility for the non-framework servers that rely on file banning (Eg; Easy Admin) etc. So hopefully this helps someone
In the Download
__resource.lua
server.lua
Pictures
Features
Player name logging
Player steam hex logging
Player game license logging
Timestamps
Easy to read for me at least
Tons of configuration. From the file name to the location.
Easy for anyone
NEW Server export function so you can use other resources to log actions!
Requirements
None. This is a standalone script duh.
Server Export Function
So how does one use the server exported function in their script?
Well, all you have to do is add the below line into a server-side script! Make sure to change the PlayerLogger part to the Player Loggers resource name you have!
Nah not really an idea just a little script. Good work tho. I believe in sharing as this community is cancerous enough already, without more saltiness.
Havent had time to check this out, but with will this have ip logging aswell? Its still a reliable identifier for me because its another way of keeping them off the server for a month or 2.
This should work, haven’t tested it however. @TreyWoods
AddEventHandler('playerConnecting', function()
local source = source
local identifierSteam = GetPlayerIdentifiers(source)[1]
local identifierRock = GetPlayerIdentifiers(source)[2]
local identifierIP = GetPlayerIdentifiers(source)[5]
local name = GetPlayerName(source)
if identifierSteam == nil then
identifierSteam = "N/A"
end
if identifierRock == nil then
identifierRock = "N/A"
end
if identifierIP == nil then
identifierIP = "N/A"
end
writeLog(name, identifierSteam, identifierRock, identifierIP)
end)
These indexes won’t always be the same. Since there is xbl: and live: identifiers on new server artifacts. Might want to check make a check, something like this:
for k,v in ipairs(GetPlayerIdentifiers(source))do
if string.sub(v, 1, string.len("steam:")) == "steam:" then
steam = v
break
elseif string.sub(v, 1, string.len("license:")) == "license:" then
license = v
break
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
ip = v
break
end
end