|
1 | 1 | # Building Restrictions |
2 | | -Set the limits for the number of buildings the player can build. |
| 2 | + |
| 3 | +A plugin that allows server admins to set limits on the number of buildings players can place in Unturned. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Limit total buildings per player |
| 8 | +- Limit barricades and structures separately |
| 9 | +- Set specific limits for different building types |
| 10 | +- Height restrictions for buildings |
| 11 | +- Location-based building limits |
| 12 | +- Multipliers for players with special permissions |
3 | 13 |
|
4 | 14 | ## Commands |
5 | | -- `/buildingstats` - Shows player the number of buildings they have built and the limit. |
6 | | -- `/buildingstats <player>` - Shows player the number of buildings the specified player has built and the limit. |
| 15 | + |
| 16 | +- `/buildingstats` - Shows your current building counts and limits |
| 17 | +- `/buildingstats <player>` - Shows another player's building counts and limits (requires permission) |
7 | 18 |
|
8 | 19 | ## Permissions |
| 20 | + |
| 21 | +- `buildingstats` - Allows using the `/buildingstats` command |
| 22 | +- `buildingstats.other` - Allows checking other players' building stats |
| 23 | +- `buildings.vip` - Example permission for multiplier (customizable) |
| 24 | + |
| 25 | +## Configuration |
| 26 | + |
| 27 | +### General Settings |
| 28 | + |
9 | 29 | ```xml |
10 | | -<Permission Cooldown="0">buildingstats</Permission> |
11 | | -<Permission Cooldown="0">buildingstats.other</Permission> |
| 30 | +<MessageColor>yellow</MessageColor> |
| 31 | +<MessageIconUrl>https://i.imgur.com/LlEcfBg.png</MessageIconUrl> |
| 32 | +<EnableMaxBuildings>false</EnableMaxBuildings> |
| 33 | +<MaxBuildings>200</MaxBuildings> |
| 34 | +<EnableMaxBarricades>false</EnableMaxBarricades> |
| 35 | +<MaxBarricades>100</MaxBarricades> |
| 36 | +<EnableMaxStructures>false</EnableMaxStructures> |
| 37 | +<MaxStructures>150</MaxStructures> |
| 38 | +<BypassAdmin>false</BypassAdmin> |
12 | 39 | ``` |
13 | 40 |
|
14 | | -## Barricade Build types |
15 | | -``` |
16 | | -FORTIFICATION, BARRICADE, DOOR, GATE, BED, LADDER, STORAGE, FARM, TORCH, CAMPFIRE, SPIKE, WIRE, GENERATOR, SPOT, SAFEZONE, FREEFORM, SIGN, VEHICLE, CLAIM, BEACON, STORAGE_WALL, BARREL_RAIN, OIL, CAGE, SHUTTER, TANK, CHARGE, SENTRY, SENTRY_FREEFORM, OVEN, LIBRARY, OXYGENATOR, GLASS, NOTE, HATCH, MANNEQUIN, STEREO, SIGN_WALL, CLOCK, BARRICADE_WALL |
17 | | -``` |
| 41 | +- `MessageColor` - Color of plugin messages |
| 42 | +- `MessageIconUrl` - Icon shown with messages |
| 43 | +- `EnableMaxBuildings` - Set to `true` to limit total buildings |
| 44 | +- `MaxBuildings` - Maximum total buildings allowed per player |
| 45 | +- `EnableMaxBarricades` - Set to `true` to limit barricades separately |
| 46 | +- `MaxBarricades` - Maximum barricades allowed per player |
| 47 | +- `EnableMaxStructures` - Set to `true` to limit structures separately |
| 48 | +- `MaxStructures` - Maximum structures allowed per player |
| 49 | +- `BypassAdmin` - Set to `true` to let admins ignore all restrictions |
18 | 50 |
|
19 | | -## Structure Construct types |
20 | | -``` |
21 | | -FLOOR, WALL, RAMPART, ROOF, PILLAR, POST, FLOOR_POLY, ROOF_POLY |
| 51 | +### Height Restrictions |
| 52 | + |
| 53 | +```xml |
| 54 | +<EnableMaxBarricadeHeight>false</EnableMaxBarricadeHeight> |
| 55 | +<MaxBarricadeHeight>100</MaxBarricadeHeight> |
| 56 | +<EnableMaxStructureHeight>false</EnableMaxStructureHeight> |
| 57 | +<MaxStructureHeight>100</MaxStructureHeight> |
22 | 58 | ``` |
23 | 59 |
|
24 | | -## Location restrictions |
25 | | -Location is considered a rectangle where the zombies can spawn and walk. It is the equalivent of navigations in Unturned map editor. |
| 60 | +- `EnableMaxBarricadeHeight` - Set to `true` to limit barricade height |
| 61 | +- `MaxBarricadeHeight` - Maximum height (in meters) for barricades |
| 62 | +- `EnableMaxStructureHeight` - Set to `true` to limit structure height |
| 63 | +- `MaxStructureHeight` - Maximum height (in meters) for structures |
| 64 | + |
| 65 | +### Location Restrictions |
| 66 | + |
26 | 67 | ```xml |
27 | 68 | <EnableMaxBuildingsPerLocation>false</EnableMaxBuildingsPerLocation> |
28 | 69 | <MaxBuildingsPerLocationHeight>100</MaxBuildingsPerLocationHeight> |
29 | 70 | <MaxBuildingsPerLocation>10</MaxBuildingsPerLocation> |
30 | 71 | ``` |
31 | | -The `MaxBuildingsPerLocationHeight` is the height above the ground where the building is considered to be in the location. |
32 | 72 |
|
33 | | -If you want to completely disable building in the locations, set `MaxBuildingPerLocation` to `0`. |
| 73 | +- `EnableMaxBuildingsPerLocation` - Set to `true` to limit buildings in specific areas |
| 74 | +- `MaxBuildingsPerLocationHeight` - Maximum height for location detection |
| 75 | +- `MaxBuildingsPerLocation` - Maximum buildings allowed in a location |
| 76 | + - Set to `0` to completely disable building in locations |
| 77 | + - The following aren't counted: Safezone Radiators, Horde Beacons, Charges, Vehicles |
34 | 78 |
|
35 | | -The following barricades are not considered for the location restrictions: |
36 | | -- Safezone Radiators |
37 | | -- Horde Beacons |
38 | | -- Charges |
39 | | -- Vehicles (which can be built) |
| 79 | +### Specific Building Limits |
40 | 80 |
|
41 | | -## Configuration |
42 | 81 | ```xml |
43 | | -<?xml version="1.0" encoding="utf-8"?> |
44 | | -<BuildingRestrictionsConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
45 | | - <MessageColor>yellow</MessageColor> |
46 | | - <MessageIconUrl>https://i.imgur.com/LlEcfBg.png</MessageIconUrl> |
47 | | - <EnableMaxBuildings>false</EnableMaxBuildings> |
48 | | - <MaxBuildings>200</MaxBuildings> |
49 | | - <EnableMaxBarricades>false</EnableMaxBarricades> |
50 | | - <MaxBarricades>100</MaxBarricades> |
51 | | - <EnableMaxStructures>false</EnableMaxStructures> |
52 | | - <MaxStructures>150</MaxStructures> |
53 | | - <BypassAdmin>false</BypassAdmin> |
54 | | - <EnableMaxBarricadeHeight>false</EnableMaxBarricadeHeight> |
55 | | - <MaxBarricadeHeight>100</MaxBarricadeHeight> |
56 | | - <EnableMaxStructureHeight>false</EnableMaxStructureHeight> |
57 | | - <MaxStructureHeight>100</MaxStructureHeight> |
58 | | - <EnableMaxBuildingsPerLocation>false</EnableMaxBuildingsPerLocation> |
59 | | - <MaxBuildingsPerLocationHeight>100</MaxBuildingsPerLocationHeight> |
60 | | - <MaxBuildingsPerLocation>10</MaxBuildingsPerLocation> |
61 | | - <Barricades> |
62 | | - <Barricade Name="sentries" Build="SENTRY" Max="5" /> |
63 | | - <Barricade Name="stereos" Build="STEREO" Max="1" /> |
64 | | - <Barricade Name="campfires" Build="CAMPFIRE" Max="2" /> |
65 | | - </Barricades> |
66 | | - <Structures> |
67 | | - <Structure Name="roofs" Construct="ROOF" Max="30" /> |
68 | | - <Structure Name="floors" Construct="FLOOR" Max="30" /> |
69 | | - </Structures> |
70 | | - <Multipliers> |
71 | | - <Multiplier Permission="buildings.vip" Multiplier="1.5" /> |
72 | | - </Multipliers> |
73 | | -</BuildingRestrictionsConfiguration> |
| 82 | +<Barricades> |
| 83 | + <Barricade Name="sentries" Build="SENTRY" Max="5" /> |
| 84 | + <Barricade Name="stereos" Build="STEREO" Max="1" /> |
| 85 | + <Barricade Name="campfires" Build="CAMPFIRE" Max="2" /> |
| 86 | + <Barricade Name="Sandbag" ItemId="365" Max="10" /> |
| 87 | +</Barricades> |
| 88 | +<Structures> |
| 89 | + <Structure Name="roofs" Construct="ROOF" Max="30" /> |
| 90 | + <Structure Name="floors" Construct="FLOOR" Max="30" /> |
| 91 | + <Structure Name="Metal Wall" ItemId="371" Max="20" /> |
| 92 | +</Structures> |
74 | 93 | ``` |
75 | 94 |
|
76 | | -## Translations |
| 95 | +- `Barricades` - List of specific barricade type restrictions |
| 96 | +- `Structures` - List of specific structure type restrictions |
| 97 | +- For each entry: |
| 98 | + - `Name` - Display name for the building type (informational only, doesn't affect functionality) |
| 99 | + - `Build` - Barricade type (use values from Barricade Build types list) |
| 100 | + - `Construct` - Structure type (use values from Structure Construct types list) |
| 101 | + - `ItemId` - Specific item ID (overrides Build/Construct) |
| 102 | + - `Max` - Maximum number allowed |
| 103 | + |
| 104 | +#### Restriction Methods: |
| 105 | +You can restrict buildings in three ways: |
| 106 | + |
| 107 | +1. **By Building Category**: Use the `Build` attribute for barricades or `Construct` for structures to restrict entire categories (e.g., all SENTRY types). |
| 108 | + |
| 109 | +2. **By Specific Item ID**: Use the `ItemId` attribute to restrict a specific item. For example: |
| 110 | + - `ItemId="365"` restricts Sandbag barricades specifically |
| 111 | + - `ItemId="371"` restricts Metal Walls specifically |
| 112 | + |
| 113 | +3. **Combined Restrictions**: You can have both category restrictions and specific item restrictions active at the same time. |
| 114 | + |
| 115 | +> **Note**: When using ItemId, you need to know the exact ID number of the item in Unturned. Using ItemId will override category-based restrictions for that specific item. The `Name` attribute is just for your reference and doesn't need to match the exact item name in Unturned. |
| 116 | +
|
| 117 | +### Permission Multipliers |
| 118 | + |
77 | 119 | ```xml |
78 | | -<?xml version="1.0" encoding="utf-8"?> |
79 | | -<Translations xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
80 | | - <Translation Id="BuildingsRestriction" Value="You can't build [[b]]{0}[[/b]] because you have reached the limit of max [[b]]{1}[[/b]] buildings." /> |
81 | | - <Translation Id="BarricadesRestriction" Value="You can't build [[b]]{0}[[/b]] because you have reached the limit of max [[b]]{1}[[/b]] barricades." /> |
82 | | - <Translation Id="StructuresRestriction" Value="You can't build [[b]]{0}[[/b]] because you have reached the limit of max [[b]]{1}[[/b]] structures." /> |
83 | | - <Translation Id="SpecificRestriction" Value="You can't build [[b]]{0}[[/b]] because you have reached the limit of max [[b]]{1} {2}[[/b]]." /> |
84 | | - <Translation Id="SpecificRestrictionInfo" Value="You have placed [[b]]{0}/{1} {2}[[/b]]." /> |
85 | | - <Translation Id="PlayerBuildingStatsYou" Value="You have placed [[b]]{0}{1}[[/b]] barricades and [[b]]{2}{3}[[/b]] structures, so in total [[b]]{4}{5}[[/b]] buildings." /> |
86 | | - <Translation Id="PlayerBuildingStats" Value="[[b]]{0}[[/b]] have placed [[b]]{1}{2}[[/b]] barricades and [[b]]{3}{4}[[/b]] structures, so in total [[b]]{5}{6}[[/b]] buildings." /> |
87 | | - <Translation Id="BuildingStats" Value="[[b]]{0}[[/b]] players have built [[b]]{1}[[/b]] barricades and [[b]]{2}[[/b]] structures, so in total [[b]]{3}[[/b]] buildings." /> |
88 | | - <Translation Id="PlayerNotFound" Value="Player [[b]]{0}[[/b]] not found." /> |
89 | | - <Translation Id="BuildingStatsOtherNoPermission" Value="You don't have permission to check other player building stats." /> |
90 | | - <Translation Id="MaxBarricadeHeightRestriction" Value="You can't build [[b]]{0}[[/b]] because it's higher than max [[b]]{1}m[[/b]] height above the ground." /> |
91 | | - <Translation Id="MaxStructureHeightRestriction" Value="You can't build [[b]]{0}[[/b]] because it's higher than max [[b]]{1}m[[/b]] height above the ground." /> |
92 | | -</Translations> |
| 120 | +<Multipliers> |
| 121 | + <Multiplier Permission="buildings.vip" Multiplier="1.5" /> |
| 122 | +</Multipliers> |
| 123 | +``` |
| 124 | + |
| 125 | +- Use multipliers to give certain players higher limits |
| 126 | +- `Permission` - The permission to check for |
| 127 | +- `Multiplier` - How much to multiply the limits (1.5 = +50%) |
| 128 | + |
| 129 | +## Building Types Reference |
| 130 | + |
| 131 | +### Barricade Types |
| 132 | +``` |
| 133 | +FORTIFICATION, BARRICADE, DOOR, GATE, BED, LADDER, STORAGE, FARM, |
| 134 | +TORCH, CAMPFIRE, SPIKE, WIRE, GENERATOR, SPOT, SAFEZONE, FREEFORM, |
| 135 | +SIGN, VEHICLE, CLAIM, BEACON, STORAGE_WALL, BARREL_RAIN, OIL, CAGE, |
| 136 | +SHUTTER, TANK, CHARGE, SENTRY, SENTRY_FREEFORM, OVEN, LIBRARY, |
| 137 | +OXYGENATOR, GLASS, NOTE, HATCH, MANNEQUIN, STEREO, SIGN_WALL, |
| 138 | +CLOCK, BARRICADE_WALL |
| 139 | +``` |
| 140 | + |
| 141 | +### Structure Types |
| 142 | +``` |
| 143 | +FLOOR, WALL, RAMPART, ROOF, PILLAR, POST, FLOOR_POLY, ROOF_POLY |
93 | 144 | ``` |
0 commit comments