Promuj serwer
csb-playtime-tracker / README.md
2 lines 1.5 KiB Markdown Source Rendered Raw Permalink History
<p><strong>CSB Playtime Tracker</strong> counts how long each SteamID has spent on your server. Time is accumulated in seconds, flushed to <strong>nVault</strong> once a minute and again on disconnect, so a crash loses at most 60 seconds. <code>say /time</code> shows a player their total hours and minutes; <code>say /toptime</code> shows a small ladder of the online players by time played.</p><p>The plugin also registers a native, <code>csb_get_playtime(id)</code>, that returns a player's live total in seconds &mdash; VIP, rewards or rank plugins can call it to unlock perks after so many hours.</p><h2>Features</h2><ul><li>Per-SteamID second-accurate accumulation, persisted in nVault.</li><li>One-minute periodic flush plus flush on disconnect and on map end.</li><li><code>say /time</code> and <code>say /toptime</code> (top 5 of the online players).</li><li><code>csb_get_playtime(id)</code> native for other plugins.</li></ul><h2>Using the native</h2><pre>native csb_get_playtime(id);
// hours = csb_get_playtime(id) / 3600;</pre><h2>Installation</h2><ol><li>Enable the <code>nvault</code> module in <code>addons/amxmodx/configs/modules.ini</code>.</li><li>Compile <code>csb_playtime_tracker.sma</code>, copy it to <code>addons/amxmodx/plugins/</code> and add it to <code>plugins.ini</code>. Load it <em>before</em> any plugin that calls its native.</li><li>Change the map. The vault file <code>csb_playtime.vault</code> appears in <code>addons/amxmodx/data/vault/</code>.</li></ol>