Accumulates connected time per SteamID in nVault, shows /time and /toptime, and exposes a csb_get_playtime() native.
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
- Per-SteamID second-accurate accumulation, persisted in nVault.
- One-minute periodic flush plus flush on disconnect and on map end.
say /timeandsay /toptime(top 5 of the online players).csb_get_playtime(id)native for other plugins.
Using the native
native csb_get_playtime(id); // hours = csb_get_playtime(id) / 3600;
Installation
- Enable the
nvaultmodule inaddons/amxmodx/configs/modules.ini. - Compile
csb_playtime_tracker.sma, copy it toaddons/amxmodx/plugins/and add it toplugins.ini. Load it before any plugin that calls its native. - Change the map. The vault file
csb_playtime.vaultappears inaddons/amxmodx/data/vault/.









