Simple Player Join Logger

Posts 1–7 of 7 · Page 1 of 1
Simple Player Join Logger
Whipped up in a minute just for funz.

Run "PrintPlayerJoinLog" in Console to show all the connected players that have joined since you joined the server.
It Shows Date and time they joined, Name, Steam ID.

Code:
Players = {}

file.CreateDir("PlayerJoinLogger")
file.Write("PlayerJoinLogger/playersconnected.txt")

function PlayersConnected()
for _, v in ipairs( player.GetAll() ) do
    if(not table.HasValue(Players, v)) then
	table.insert(Players, v)
    file.Append("PlayerJoinLogger/playersconnected.txt", "("..tostring( os.date() )..") Player "..v:Nick().." ("..v:SteamID()..")\n")
end
end
end
hook.Add("Think","PlayersConnected",PlayersConnected)

function PrintPlayers()
	if file.Read("PlayerJoinLogger/playersconnected.txt") == nil then
	   print("No players have joined!")
	else
	   print(file.Read("PlayerJoinLogger/playersconnected.txt"))
end
end
concommand.Add( "PrintPlayerJoinLog", PrintPlayers )
why not use the PlayerConnect hook?
Quote Originally Posted by niller303 View Post
why not use the PlayerConnect hook?
Thank you! That's very useful. I didn't know about that ._.
There's a sticky thread where you should post small scripts like this.
Also what would be a practical usage example of this?
It is useful to just print to console their shit instead of getting steamid. Also you get the date and time :3
How is this cheating exactly?
It's not fellow myg0tian.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?