• How to show steamIDs on Connect and Disconnect?
    8 replies, posted
How do you make it show peoples steamid's when they connect and disconnect? Show it in the chat.
This is the wrong section, you should post it in lua questions. [editline]16th March 2011[/editline] Connect: [lua] function GM:PlayerConnect( player ) print( "Player " .. player .. " has joined with the SteamID " ..player:SteamID()) end [/lua] Should work, wrote it fast. And, you should search before. [url]http://wiki.garrysmod.com/?title=Gamemode_Hooks[/url]
This works too. [lua] function FirstSpawn( ply ) PrintMessage( HUD_PRINTTALK, ply:Nick().. " entered the server, their SteamID is: " ..ply:SteamID() ) end hook.Add( "PlayerInitialSpawn", "playerInitialSpawn", FirstSpawn ) function PlayerDisconnect( ply ) PrintMessage( HUD_PRINTTALK, ply:Nick().. " has disconnected, their SteamID is: " ..ply:SteamID() ) end hook.Add( "PlayerDisconnected", "playerDisconnected", PlayerDisconnect ) [/lua]
[QUOTE=Persious;28626472] And, you should search before. [url]http://wiki.garrysmod.com/?title=Gamemode_Hooks[/url][/QUOTE] If you look at the wiki page GM:PlayerConnect( String name, String address ) I don't see the player object do you? you should search before you post OP if you want it at the earliest possible time use GateKeeper
Hes not asking about GateKeeper.
[QUOTE=Persious;28635960]Hes not asking about GateKeeper.[/QUOTE] [QUOTE=blksith0;28626224]when they connect[/QUOTE] He didn't specify how early he wanted it to be called Gate Keeper is a method of accessing the SteamID at the earliest time possible, this is a working solution unlike trying to access the player object through PlayerConnect that clearly wont work since its not valid.
You need to know how to use Gate Keeper. So why use Gate Keeper when you can use what noforgivin posted?
Indeed. Works on my server :D
[QUOTE=Persious;28637913]You need to know how to use Gate Keeper. So why use Gate Keeper when you can use what noforgivin posted?[/QUOTE] Sorry for offering an alternate solution
Sorry, you need to Log In to post a reply to this thread.