CSB Playtime Tracker counts how long each SteamID has spent on your server. Time is accumulated in seconds, flushed to nVault once a minute and again on disconnect, so a crash loses at most 60 seconds. say /time shows a player their total hours and minutes; say /toptime shows a small ladder of the online players by time played.

The plugin also registers a native, csb_get_playtime(id), that returns a player's live total in seconds — VIP, rewards or rank plugins can call it to unlock perks after so many hours.

Features

Using the native

native csb_get_playtime(id);
// hours = csb_get_playtime(id) / 3600;

Installation

  1. Enable the nvault module in addons/amxmodx/configs/modules.ini.
  2. Compile csb_playtime_tracker.sma, copy it to addons/amxmodx/plugins/ and add it to plugins.ini. Load it before any plugin that calls its native.
  3. Change the map. The vault file csb_playtime.vault appears in addons/amxmodx/data/vault/.