Promouvoir serveur
62 lines 5.6 KiB Markdown Source Rendered Raw Permalink History
---
title: "How to Find a Player's SteamID (Live and From Logs)"
excerpt: "Pull a player's SteamID live with status and amx_who, extract it from server logs, understand the non-Steam cases, and use it to ban with persistence."
category: "administration"
tags: "steamid, logs"
image: ""
read_time: "8 min read"
---
<p>Almost every moderation action on a CS 1.6 server starts with one thing: the offender's SteamID. You need it to ban the person rather than a name they can change or an IP they share with an ISP. This covers getting the ID while they are connected, digging it out of the logs after they leave, the non-Steam wrinkles, and turning the ID into a ban that survives a restart.</p>

<h2>1. Live, from the console: status</h2>
<p>The fastest method. In the server console or over RCON:</p>
<pre>status</pre>
<p>Each connected player prints a block like:</p>
<pre># userid name                unique                team
# 12 "Nova"     STEAM_0:1:12345678   CT   45 67ms</pre>
<p>The <code>unique</code> column is the SteamID (<code>STEAM_0:x:yyyyyyyy</code>), and the leading <code>#12</code> is the <em>userid</em> — the transient slot number you use for <code>kick</code> and RCON commands during this session. The SteamID is the stable identity; the userid resets every map.</p>

<h2>2. Live, from in-game admin: amx_who</h2>
<p>With AMX Mod X, an admin can run in chat or console:</p>
<pre>amx_who</pre>
<p>It lists every player with their name, SteamID (authid), current access flags and immunity. This is the admin-friendly version of <code>status</code> and it also tells you at a glance who else on the server has admin. It reads identities from <code>configs/users.ini</code>, the same file that defines your <a href="/tutorials/plugins-ini-load-order">admin flags</a>.</p>

<h2>3. From the logs, after they left</h2>
<p>Server logs live in <code>cstrike/logs/</code> as dated <code>L*.log</code> files, and every connect line carries the SteamID. Grep for the name or the action:</p>
<pre>cd /home/steam/hlds/cstrike/logs
grep -i "nova" L*.log</pre>
<p>Connect and kill lines embed the ID in angle brackets:</p>
<pre>"Nova&lt;12&gt;&lt;STEAM_0:1:12345678&gt;&lt;CT&gt;" killed "Ghost&lt;9&gt;..."</pre>
<p>The three fields in the brackets are name, userid, and SteamID. Even if you missed the player live, the log has their ID as long as logging is on (<code>log on</code>, <code>mp_logdetail 3</code> — see <a href="/tutorials/essential-server-cvars">essential cvars</a>).</p>

<h2>4. The non-Steam cases</h2>
<p>SteamIDs are only trustworthy on a server that validates them. On a non-Steam server running <a href="/tutorials/install-reunion">Reunion</a> or dproto, IDs depend on the client:</p>
<ul>
<li>A pending client may briefly show <code>STEAM_ID_PENDING</code> before resolving.</li>
<li>Reunion can be configured to hand non-Steam clients generated, stable IDs — but two different people with the same cracked client can collide unless it is configured correctly. See <a href="/tutorials/fix-duplicate-steamids-nonsteam">duplicate SteamIDs on non-Steam</a>.</li>
<li>The <code>0</code> vs <code>1</code> in <code>STEAM_0:X:</code> is the auth server digit and is part of the ID — do not "normalize" it away when banning.</li>
</ul>
<p>On a mixed server, treat the SteamID as the identity but keep the IP as a secondary signal for repeat offenders whose IDs you cannot trust.</p>

<h2>5. Turn the ID into a persistent ban</h2>
<p>Once you have the SteamID, ban it. With AMX Mod X the clean way is a command that writes the ban and boots them in one step:</p>
<pre>amx_ban 30 "Nova" cheating          // ban a connected player, 30 minutes
amx_addban "STEAM_0:1:12345678" 0 cheating   // ban by ID, 0 = permanent</pre>
<p>At the engine level the same is done with <code>banid</code>, and the crucial second step is persistence:</p>
<pre>banid 0 STEAM_0:1:12345678
writeid</pre>
<p><strong><code>writeid</code> is what saves the ban to <code>banned.cfg</code></strong> so it survives a restart; a <code>banid</code> without it evaporates on the next map or reboot. For IP bans the pair is <code>addip</code> / <code>writeip</code>, and <code>listid</code> / <code>listip</code> show the current lists. A menu-driven <a href="/plugins/csb-ban-manager">ban manager</a> or the <a href="/plugins/csb-admin-menu">admin menu</a> wraps all of this so you never fat-finger a raw <code>banid</code>.</p>

<h2>Common errors</h2>
<ul>
<li><strong>Ban gone after restart</strong> — you ran <code>banid</code> without <code>writeid</code> (or <code>addip</code> without <code>writeip</code>). The ban was never written to disk.</li>
<li><strong><code>amx_ban</code> says no such player</strong> — the player already disconnected; use <code>amx_addban</code> with the SteamID from the logs instead.</li>
<li><strong>Banned the wrong person</strong> — you used the userid (<code>#12</code>) as if it were stable. It is a per-session slot; always ban the SteamID.</li>
<li><strong>Non-Steam ban does not stick</strong> — the client's ID changes between sessions. Reunion needs a proper <code>SteamIdHashSalt</code> and configuration; an IP ban may be the only reliable lever.</li>
<li><strong>SteamID missing from logs</strong> — logging was off. Set <code>log on</code> and <code>mp_logdetail 3</code> before you need it.</li>
</ul>

<h2>Verification</h2>
<p>Run <code>status</code> and confirm you can read the SteamID of everyone on the server. After banning, check the list persisted:</p>
<pre>listid</pre>
<p>The banned SteamID should appear. Restart the server and run <code>listid</code> again — if it is still there, <code>writeid</code> did its job and the ban is permanent. If it vanished, you skipped the write step.</p>