aaron
Retro-Recruit
Posts: 9
|
Post by aaron on Jul 10, 2014 18:51:34 GMT
As I have been a trial - moderator for a short time, I have been having problems with people mass rdming then leaving. It can be a real pain to try to find their steam id. So, I think that a plugin displaying a players steam id when they connect and disconnect would be really helpful. I have looked through forums online and have found a script that might work.
local logfile = file.Read("logs.txt", "DATA")
local steamids = {}
if logfile != nil then
steamids = util.JSONToTable(logfile)
end
hook.Add( "PlayerInitialSpawn", "Store Ply Details", function( ply )
steamids[ply:SteamID()] = ply:Name()
file.Write("logs.txt", util.TableToJSON(steamids) )
end )
concommand.Add("getsteamid", function( ply, cmd, args )
if ply:IsAdmin() and args[1] != nil then
ply:PrintMessage(HUD_PRINTTALK, "Searching logs for: "..args[1])
for steamid, name in pairs(steamids) do
if name == args[1] then
ply:PrintMessage(HUD_PRINTTALK, "Name match for "..args[1].. " SteamID: "..steamid)
end
end
end
end)
You probably already know this but the file would be placed in addons/<addon_name>/lua/autorun/server/whatever.lua where <addon_name> is whatever name you want to give it without the < >s, such as server_addons, and whatever.lua can be anything you want too, so long as the extension is lua.
This is pretty much what I found out looking through the facepunch forums.
|
|
|
Post by kennythefatnord on Jul 10, 2014 19:25:39 GMT
You could type status in console once you join.
|
|
aaron
Retro-Recruit
Posts: 9
|
Post by aaron on Jul 10, 2014 19:39:24 GMT
Ya, but when another player joins later it won't show it. Mainly I just want it to show their steamid when they disconnect.
|
|
|
Post by Vioteck on Jul 10, 2014 21:45:13 GMT
It's very easy to check steamids, whenever someone leaves it says dropped then the players name and steamId
|
|