gmcl_steamid

GMod update 72 made SteamID and UniqueID shared. This module has no purpose now.

Use http://wiki.garrysmod.com/?title=Player.SteamID and http://wiki.garrysmod.com/?title=Player.UniqueID instead.

Purpose: This module adds one function. It behaves just like the server-side SteamID function.

Installation: Place gmcl_steamid.dll in “garrysmod\lua\includes\modules”.

Usage:
[lua]
require(“steamid”)

//print the SteamIDs of everyone in the server
for k, ply in pairs(player.GetAll()) do
print(ply:SteamID())
end
[/lua]

Download and source: http://ers35.nfshost.com/files/gmcl_steamid.zip

Getting an error? Install this: http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en

Nice. Did you also include UniqueID()?

You made a mistake with the format. It should start with “STEAM_0:”, not “STEAM_:0:”.

this is generated on server I believe

It’s a hash of the steamID.

No. I might add UniqueID() later.

Fixed. Thanks.

I never got the use of steamid clientside.

This makes it easy to uniquely identify players in client-side scripts. For example, you can store all the names of players you have seen and identify them later even if they have changed their name completely. (I did not rate you dumb.)

I would generally use EntIndex for this, then you can get the player object with player.GetByID serverside and clientside.

You are missing the point. EntIndexes change from server to server. SteamIDs do not.

Hmm, good reason, I just got a idea for this ;).

Ratings dont mean shit to me.

I did miss the point, i thought you meant storing the player clientside for use on the same server.

A basic and kinda shitty script i made with this lol to store names on steamid clientside :D:
[lua]
require( “steamid” )
require( “glon” ) – yer

local PlayerStorageTable = {}

local SafeConAdd = concommand.Add

local function LoadStorage()
if ( file.Exists( “PlayerInfoStorage/data.txt” ) ) then
local Data = glon.decode( file.Read( “PlayerInfoStorage/data.txt” ) )

	for k, v in pairs( Data ) do
		PlayerStorageTable[ k ] = v
	end
	
	print( "Loaded player info storage" )
	PrintTable( PlayerStorageTable )
end

end
SafeConAdd( “storageinit”, LoadStorage )

local function UpdateStorage()
for k, v in pairs( player.GetAll() ) do
if ( PlayerStorageTable[ v:SteamID() ] == nil ) then
PlayerStorageTable[ v:SteamID() ] = {}
PlayerStorageTable[ v:SteamID() ].Names = { v:Nick() }

		file.Delete( "PlayerInfoStorage/data.txt" )
		file.Write( "PlayerInfoStorage/data.txt", glon.encode( PlayerStorageTable ) )
	else
		if ( !table.HasValue( PlayerStorageTable[ v:SteamID() ].Names, v:Nick() ) ) then
			table.insert( PlayerStorageTable[ v:SteamID() ].Names, v:Nick() )
			file.Delete( "PlayerInfoStorage/data.txt" )
			file.Write( "PlayerInfoStorage/data.txt", glon.encode( PlayerStorageTable ) )
		end
	end
end

end
SafeConAdd( “updatestorage”, UpdateStorage )

local function PlayerInfoStorageMenu()
local DFrame = vgui.Create( “DFrame” )
DFrame:SetSize( 400, 400 )
DFrame:Center()
DFrame:SetTitle( “PlayerInfoStorage Menu” )
DFrame:MakePopup()

local DListView = vgui.Create( "DListView" )
DListView:SetParent( DFrame )
DListView:SetSize( DFrame:GetWide() - 10, DFrame:GetTall() - 35 )
DListView:SetPos( 5, 30 )
DListView:SetMultiSelect( false )
DListView:AddColumn( "Name" )
DListView:AddColumn( "SteamID" )

for k, v in pairs( PlayerStorageTable ) do
	if ( PlayerStorageTable[ k ].Names[ 2 ] != nil ) then
		DListView:AddLine( PlayerStorageTable[ k ].Names[ 2 ], k )
	else
		DListView:AddLine( PlayerStorageTable[ k ].Names[ 1 ], k )
	end
end

DListView.OnClickLine = function( P, S, I )
	local ListPreviousNames = DermaMenu()
		local Line = S:GetValue( 2 )
		
		for k, v in pairs( PlayerStorageTable[ Line ].Names ) do
			ListPreviousNames:AddOption( v )
		end
	ListPreviousNames:Open()
end

end
SafeConAdd( “storagemenu”, PlayerInfoStorageMenu )
[/lua]

Then how is different every server you join?

Hmm… This doesn’t seem to be working for me. I just found a use for this too…

I installed that thing in the OP, but I keep getting this error when the script loads.



error loading module 'steamid' from file 'c:\program files (x86)\steam\steamapps\blackops\garrysmod\garrysmod\lua\includes\modules\gmcl_steamid.dll':
	system error 14001


Well… Look like this module doesn’t like me for some reason.
So much for my SteamFriends look-a-like player list. xD

hash of client id and steam id?

or is the unique id the client id? whatever who gives a fuck

The module doesn’t work for me either, even after installing fix in the OP.

Install .Net Framework

Are you suggesting this because you know it will work, or because you think it might work? Why would this help?

Gatekeeper gave me that error on my server, I installed it and it worked.