HitchLimit
Control how many horses each player can have hitched to their hitch posts
# HitchLimit
HitchLimit allows server owners to control how many horses each player can have hitched to their hitch posts. Limits can be configured globally and increased through permission-based tiers.
Features
* Configurable default horse hitch limit
* Three permission-based limit tiers
* Prevents players from exceeding their configured horse limit
* Optional automatic removal of horses over the limit when the plugin loads
* On-screen CUI notifications showing the current hitch count and limit
* Customizable notification appearance, position, colors, font size, fade times, and icon skin
* Player command to unhitch all of their horses
* Admin commands for monitoring and clearing hitched horses
* Rebuilds its horse tracking data when the plugin starts
* Designed to scan large entity counts gradually to reduce server performance impact
Default Limits
| Tier | Permission | Default Limit |
| ------- | ------------------- | ------------: |
| Normal | None | 8 |
| Level 1 | HitchLimit.Level1 | 16 |
| Level 2 | HitchLimit.Level2 | 32 |
| Level 3 | HitchLimit.Level3 | 64 |
Higher permission tiers take priority, with Level 3 providing the highest configured limit.
Permissions
HitchLimit.Level1
HitchLimit.Level2
HitchLimit.Level3
HitchLimit.Unhitch
HitchLimit.Admin
Permission Details
* HitchLimit.Level1 — Gives the player the Level 1 hitch limit.
* HitchLimit.Level2 — Gives the player the Level 2 hitch limit.
* HitchLimit.Level3 — Gives the player the Level 3 hitch limit.
* HitchLimit.Unhitch — Allows the player to use /unhitchall.
* HitchLimit.Admin — Allows players to use the trough.count and trough.unhitchall console commands.
Commands
Player Command
/unhitchall
Unhitches all horses currently hitched to the player's hitch posts.
Console Commands
trough.count
Displays the number of horses currently tracked as hitched for each player.
trough.unhitchall
Unhitches all tracked horses belonging to all players on the server.
The console commands require HitchLimit.Admin when executed by a player. RCON and server console execution is also supported.
Configuration
The plugin provides configuration options for:
* Default horse hitch limit
* Level 1, 2, and 3 limits
* Automatically unhitching horses over the limit on plugin load
* Notification font size and color
* Accepted/rejected notification background colors
* Fade-in and message display duration
* Notification screen position
* Notification icon Skin ID
Default Configuration
{
"OnLoad Unhitch Horses Over Limit": false,
"Horse Hitch Limit Normal": 8,
"Horse Hitch Limit Level 1": 16,
"Horse Hitch Limit Level 2": 32,
"Horse Hitch Limit Level 3": 64,
"Popup Info Font Size": 15,
"Popup Info Font Colour": "1 1 1 1",
"Popup Info Background Color Accepted": "0.18 0.18 0.18 0.8",
"Popup Info Background Color Reject": "1 0 0 0.8",
"Popup Info Fade In": 2,
"Popup Info Clear Message Delay": 4,
"Popup Info AnchorMin": "0.84 0.9",
"Popup Info AnchorMax": "1 1",
"Popup Info Icon (SkinID)": 0
}
How It Works
When a horse is hitched, HitchLimit checks the hitch post owner and determines the player's allowed limit based on their permissions. If the player is already at their limit, the horse is automatically unhitched and a rejection notification is displayed.
When a horse is successfully hitched, the player's current horse count is displayed through the plugin's CUI notification.
The plugin also tracks horses being unhitched, led away, or destroyed so its internal count stays synchronized.
Note: Unclaimed/public hitch posts are ignored by the tracking system, so they do not contribute to a player's hitch limit.
Installation
1. Download HitchLimit.cs.
2. Place it in your server's Oxide/uMod plugins directory.
3. Restart the server or reload the plugin.
4. Configure the generated HitchLimit.json configuration file if required.
5. Assign the appropriate permissions to your player groups.
