[b]GMod update 72 made SteamID and UniqueID shared. This module has no purpose now.[/b]
[b]Use [url]http://wiki.garrysmod.com/?title=Player.SteamID[/url] and [url]http://wiki.garrysmod.com/?title=Player.UniqueID[/url] instead.[/b]
[b]Purpose:[/b] This module adds one function. It behaves just like the server-side SteamID function.
[b]Installation:[/b] Place gmcl_steamid.dll in "garrysmod\lua\includes\modules".
[b]Usage:[/b]
[lua]
require("steamid")
//print the SteamIDs of everyone in the server
for k, ply in pairs(player.GetAll()) do
print(ply:SteamID())
end
[/lua]
[b]Download and source:[/b] [url]http://ers35.nfshost.com/files/gmcl_steamid.zip[/url]
Getting an error? Install this: [url]http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en[/url]
Nice. Did you also include UniqueID()?
You made a mistake with the format. It should start with "STEAM_0:", not "STEAM_:0:".
[QUOTE=Lexic;16235306]Nice. Did you also include UniqueID()?[/QUOTE]
this is generated on server I believe
[QUOTE=Termy58;16235475]this is generated on server I believe[/QUOTE]
It's a hash of the steamID.
[QUOTE=Lexic;16235306]Nice. Did you also include UniqueID()?[/QUOTE]
No. I might add UniqueID() later.
[QUOTE=Nevec;16235404]You made a mistake with the format. It should start with "STEAM_0:", not "STEAM_:0:".[/QUOTE]
Fixed. Thanks.
I never got the use of steamid clientside.
[QUOTE=ChewGum;16240856]I never got the use of steamid clientside.[/QUOTE]
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.)
[QUOTE=ers35.;16240891]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.)[/QUOTE]
I would generally use EntIndex for this, then you can get the player object with player.GetByID serverside and clientside.
[QUOTE=MakeR;16240920]I would generally use EntIndex for this, then you can get the player object with player.GetByID serverside and clientside.[/QUOTE]
You are missing the point. EntIndexes change from server to server. SteamIDs do not.
[QUOTE=ers35.;16240891]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.)[/QUOTE]
Hmm, good reason, I just got a idea for this ;).
Ratings dont mean shit to me.
[QUOTE=ers35.;16240946]You are missing the point. EntIndexes change from server to server. SteamIDs do not.[/QUOTE]
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]
[QUOTE=Lexic;16235504]It's a hash of the steamID.[/QUOTE]
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.
[code]
error loading module 'steamid' from file 'c:\program files (x86)\steam\steamapps\blackops\garrysmod\garrysmod\lua\includes\modules\gmcl_steamid.dll':
system error 14001
[/code]
Well.. Look like this module doesn't like me for some reason.
So much for my SteamFriends look-a-like player list. xD
[url]http://i30.tinypic.com/34t5xzd.png[/url]
[QUOTE=Termy58;16360474]Then how is different every server you join?[/QUOTE]
hash of client id and steam id?
or is the unique id the client id? whatever who gives a fuck
[QUOTE=blackops7799;16405155]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.
[code]
error loading module 'steamid' from file 'c:\program files (x86)\steam\steamapps\blackops\garrysmod\garrysmod\lua\includes\modules\gmcl_steamid.dll':
system error 14001
[/code]
Well.. Look like this module doesn't like me for some reason.
So much for my SteamFriends look-a-like player list. xD
[url]http://i30.tinypic.com/34t5xzd.png[/url][/QUOTE]
The module doesn't work for me either, even after installing fix in the OP.
[QUOTE=Nikolai Resokav;16469221]The module doesn't work for me either, even after installing fix in the OP.[/QUOTE]
Install .Net Framework
[url]http://www.microsoft.com/downloads/details.aspx?familyid=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en[/url]
[QUOTE=slayer3032;16471790]Install .Net Framework
[url]http://www.microsoft.com/downloads/details.aspx?familyid=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en[/url][/QUOTE]
Are you suggesting this because you know it will work, or because you think it might work? Why would this help?
[QUOTE=ers35.;16471902]Are you suggesting this because you know it will work, or because you think it might work? Why would this help?[/QUOTE]
Gatekeeper gave me that error on my server, I installed it and it worked.
[QUOTE=slayer3032;16471982]Gatekeeper gave me that error on my server, I installed it and it worked.[/QUOTE]
Thanks. Added to the first post.
[QUOTE=slayer3032;16471982]Gatekeeper gave me that error on my server, I installed it and it worked.[/QUOTE]
Hahahaha, gatekeeper doesn't use any part of .NET at all, period. You were missing [url=http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en]this[/url] or [url=http://www.microsoft.com/downloads/details.aspx?FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displaylang=en]this[/url]. If installing .NET helped, it's because the 2008 redist package was included.
[QUOTE=ComWalk;16472347]Hahahaha, gatekeeper doesn't use any part of .NET at all, period. You were missing [url=http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en]this[/url]. If installing .NET helped, it's because the 2008 redist package was included.[/QUOTE]
That is what I thought. I will link to this instead.
[QUOTE=ComWalk;16472347]Hahahaha, gatekeeper doesn't use any part of .NET at all, period. You were missing [url=http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en]this[/url]. If installing .NET helped, it's because the 2008 redist package was included.[/QUOTE]
Well, I downloaded and installed that. Didn't work at all, still get the error. I even got the 64bit version because I'm running 64bit but it still didn't work.. Soooo explain that?
[QUOTE=ComWalk;16472347]Hahahaha, gatekeeper doesn't use any part of .NET at all, period. You were missing [url=http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en]this[/url]. If installing .NET helped, it's because the 2008 redist package was included.[/QUOTE]
Well, I tried installing the VC++ 2008 redist package but it didn't work.
I don't know what was going on but the .Net Framework seemed to fix it.
[QUOTE=blackops7799;16472561]Well, I downloaded and installed that. Didn't work at all, still get the error. I even got the 64bit version because I'm running 64bit but it still didn't work.. Soooo explain that?[/QUOTE]
X64 only, or x64 in addition to x86? All gmod binaries are x86 and subsequently require x86 runtimes to function. An x86 executable can not load x64 libraries. Even if the 2008 runtimes alone don't fix it, I can guarantee that there's some other dependency that you are failing to meet which simply happens to be included with the .NET download. Neither this module nor mine use .NET in any way.
If you want to prove me wrong, open the Event Viewer (start -> run -> eventvwr.msc) and look for 14001 errors. That will give you more information on what it failed to find. Just paste the whole entry in here. It'll be under Windows -> System once you have the event viewer open.
[QUOTE=ComWalk;16472612]X64 only, or x64 in addition to x86? All gmod binaries are x86 and subsequently require x86 runtimes to function. An x86 executable can not load x64 libraries. And even if the 2008 runtimes alone don't fix it, I can guarantee that there's some other dependency that you are failing to meet which simply happens to be included with the .NET download. Neither this module nor mine use .NET in any way.[/QUOTE]
I don't remember, I think I tried both.
[QUOTE=slayer3032;16472732]I don't remember, I think I tried both.[/QUOTE]
Then please dig up the 14001 errors so we can know what is actually being missed so that we can link to a more specific package in the future.
[QUOTE=ComWalk;16472748]Then please dig up the 14001 errors so we can know what is actually being missed so that we can link to a more specific package in the future.[/QUOTE]
There weren't any, someone else having the problem will have to try to help.
There's also [url=http://www.microsoft.com/downloads/details.aspx?FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displaylang=en]this[/url] x86 runtime that is required for gatekeeper. I'm not sure if it's the same for this module, but I'm pretty sure our development environments are the same.
Sorry, you need to Log In to post a reply to this thread.