- Credits System - Players earn credits over time and through kills
- Coinflip - Gamble credits with configurable multipliers
- Shop System - Database-driven shop with categories and items
- Cosmetics System - Integrated cosmetics including:
- Tags - Custom chat tags with colors
- Trails - Player trails with special effects (spectrum, breathing, bow)
- Footprints - Temporary ground effects on player movement
- Spawn Particles - Particle effects on player spawn
- Inventory - View and equip owned items
- Preferences - Player-configurable settings
- Database Integration - MySQL with caching for optimal performance
- Audit Logging - Track all player transactions
- SourceMod 1.11+
- Metamod:Source
- MySQL Database
- Grab the latest release from the release page and unzip it in your sourcemod folder.
- Configure your database in
addons/sourcemod/configs/databases.cfg:"hub" { "driver" "mysql" "host" "localhost" "database" "hub" "user" "your_user" "pass" "your_password" } - Restart the server or type
sm plugins load hubin the console to load the plugin. - The config file will be automatically generated in
cfg/sourcemod/
Once the plugin has been loaded, you can modify the cvars in cfg/sourcemod/hub.cfg:
| CVar | Default | Description |
|---|---|---|
hub_credits_minute | 4 | Minutes between automatic credit rewards |
hub_credits_amount | 20 | Credits given per interval |
hub_credits_coinflip_multiplier | 1.1 | Multiplier for coinflip wins |
hub_credits_kill_for_credits | 1 | Enable credits on kill |
hub_credits_kill_for_credits_points | 2 | Credits transferred per kill |
sm_hub_trails_enabled | 1 | Enable trails system |
sm_hub_trails_force_cheap | 0 | Force low-quality trails |
sm_hub_trails_remove_on_respawn | 0 | Remove trail on respawn |
sm_hub_trails_allow_hide | 1 | Allow hiding other players' trails |
translations/hub.phrases.txt- Main translation filetranslations/hub-shop.phrases.txt- Shop-specific phrases
All cosmetic configuration files are located in configs/hub/:
"tags-list"
{
"0"
{
"name" "[VIP]" // Tag text displayed in chat
"color" "FFD700" // Hex color (without #)
"enabled" "1" // 1 = enabled, 0 = disabled
}
"1"
{
"name" "[MVP]"
"color" "00FF00"
"enabled" "1"
}
// Use "{empty}" for spacers in menus
"2"
{
"name" "{empty}"
}
}"trails-list"
{
"0"
{
"name" "Rainbow" // Display name
"color_type" "1" // 0=solid, 1=spectrum, 2=velocity
"red" "255" // Red channel (0-255)
"green" "0" // Green channel (0-255)
"blue" "0" // Blue channel (0-255)
"alpha" "128" // Opacity (0-255)
"width" "1.5" // Beam width
"duration" "1.5" // Trail fade duration
"cheap" "0" // 1 = low quality render
"admins_only" "0" // 1 = admin only
// Breathing effect (pulsing alpha)
"breathing_min_alpha" "64"
"breathing_max_alpha" "192"
"breathing_speed" "1"
// Bow effect (pulsing width)
"bow_min_width" "1.0"
"bow_max_width" "3.0"
"bow_transform_speed" "0.1"
// Spectrum cycle speed
"spectrum_cycle_speed" "1"
}
}| Command | Description |
|---|---|
sm_hub | Opens the main hub menu |
sm_credits | Shows your current credits |
sm_coinflip <amount> | Gamble credits |
sm_shop | Opens the shop |
sm_inventory | Opens your inventory |
sm_tags | Opens the tags menu |
sm_customtag <text> | Set your custom tag text (requires [Custom Tag] item) |
sm_customtagcolor <#RRGGBB|team|green|olive> | Set your custom tag color (requires [Custom Tag] item) |
sm_trails / sm_trail | Opens the trails menu |
sm_hidetrail | Toggle hiding other players' trails |
sm_footprints / sm_footsteps | Opens the footprints menu |
sm_sp / sm_spawnparticles | Opens the spawn particles menu |
| Command | Description |
|---|---|
sm_givecredits <target> <amount> | Give credits to a player |
sm_setcredits <target> <amount> | Set a player's credits |
sm_removecredits <target> <amount> | Remove credits from a player |
HubCore provides natives for other plugins to interact with:
// Check if the database is readynativeboolHub_IsDatabaseReady();
// Check if player data is loadednativeboolHub_IsPlayerDataLoaded(intclient);
// Credit managementnativeintHub_GetPlayerCredits(intclient);
nativevoidHub_SetPlayerCredits(intclient, intcredits, constchar[] source = "", constchar[] reason = "");
nativevoidHub_AddPlayerCredits(intclient, intamount, constchar[] source = "", constchar[] reason = "");
nativevoidHub_RemovePlayerCredits(intclient, intamount, constchar[] source = "", constchar[] reason = "");
// Player selection (cosmetics)nativeboolHub_GetPlayerSelection(intclient, constchar[] type, char[] buffer, intmaxlen);
nativevoidHub_SetPlayerSelection(intclient, constchar[] type, constchar[] value);
nativevoidHub_ClearPlayerSelection(intclient, constchar[] type);
// Player settingsnativeboolHub_GetPlayerSettingBool(intclient, constchar[] key, booldefaultValue = false);
nativevoidHub_SetPlayerSettingBool(intclient, constchar[] key, boolvalue);
nativeintHub_GetPlayerSettingInt(intclient, constchar[] key, intdefaultValue = 0);
nativevoidHub_SetPlayerSettingInt(intclient, constchar[] key, intvalue);
nativevoidHub_GetPlayerSettingString(intclient, constchar[] key, char[] buffer, intmaxlen, constchar[] defaultValue = "");
nativevoidHub_SetPlayerSettingString(intclient, constchar[] key, constchar[] value);
// Shop integrationnativeboolHub_HasPlayerItemName(intclient, constchar[] categoryName, constchar[] itemName);
// UtilitynativevoidHub_GetPlayerSteamID(intclient, char[] buffer, intmaxlen);
nativevoidHub_GetPlayerSteamID64(intclient, char[] buffer, intmaxlen);
nativeintHub_GetPlayerPlayTime(intclient);
nativeintHub_GetPlayerSessionTime(intclient);
nativevoidHub_FlushPlayerCache(intclient);
// TagsnativevoidTags_GetPlayerTag(intclient, char[] buffer, intmaxlen);
nativeintTags_GetPlayerTagColor(intclient);
nativevoidTags_SetPlayerTag(intclient, inttagIndex);
nativevoidTags_ClearPlayerTag(intclient);
nativevoidTags_OpenMenu(intclient);
// TrailsnativeintTrails_GetPlayerTrail(intclient);
nativevoidTrails_SetPlayerTrail(intclient, inttrailIndex);
nativevoidTrails_ClearPlayerTrail(intclient);
nativevoidTrails_ToggleHideTrails(intclient);
nativeboolTrails_IsHidingTrails(intclient);
nativevoidTrails_OpenMenu(intclient);
// FootprintsnativeintFootprints_GetPlayerFootprint(intclient);
nativevoidFootprints_SetPlayerFootprint(intclient, intfootprintIndex);
nativevoidFootprints_ClearPlayerFootprint(intclient);
nativevoidFootprints_OpenMenu(intclient);