车辆许可证允许玩家购买车辆,然后生成或存储它。
权限
此插件使用权限系统。要分配权限,请使用 。要删除权限,请使用 。oxide.grant <user or group> <name or steam id> <permission>oxide.revoke <user or group> <name or steam id> <permission>
可以在配置中更改每个车辆的权限
- vehiclelicence.use-- 基本权限。您必须拥有它才能使用此插件
- vehiclelicence.bypasscost-- 免费购买所有车辆。
- vehiclelicence.all-- 拥有此权限的玩家可以购买所有车辆。
- vehiclelicence.admin-- 绕过抢劫和挂载检测
命令
此插件使用相同的语法提供聊天和控制台命令。在聊天中使用命令时,请为其添加正斜杠前缀: '/'。
通用聊天命令
通用命令:当你键入 /mini 时,如果你没有那个迷你直升机,插件会尝试在生成它之前为你购买它。如果您已经生成了一个,插件将尝试向您调用它。"Use Universal Chat Command" = true---> 启用通用聊天命令
// If universal chat commands are enabled. /mini and /minicopter will become a universal command
"Commands": [
"mini",
"minicopter"
]
"Custom Kill Chat Command Prefix": "no",--> /nomini 和 /nominicopter 将成为杀死车辆的命令
聊天命令
- /license-- 向玩家提供帮助。
- /buy-- 显示 buy 命令的帮助。购买许可证
- /spawn-- 显示 spawn 命令的帮助。生成一辆车
- /recall-- 显示 call 命令的帮助。将车辆召回玩家附近
- /kill-- 显示 kill 命令的帮助。杀死玩家的车辆
控制台命令
- vl.buy-- 类似于 /buy。
- vl.buy <vehicle type> all-- 为所有玩家购买车辆许可证
- vl.buy <vehicle type> <player name or id>-- 绕过成本,直接购买车辆牌照。用于 GUIShop 和 ServerRewards...例如:'vl.buy rhib 76561198924840872'
- vl.remove <vehicle type> all-- 移除所有玩家的车辆许可证
- vl.remove <vehicle type> <player name or id>-- 删除玩家的车辆许可证
- vl.spawn-- 类似于 /spawn。
- vl.recall-- 类似于 /recall。
- vl.kill-- 类似于 /kill。
Vehicles include normal vehicles and modular vehicles :
Normal Vehicle Type:
Rowboat,
Tugboat,
RHIB,
Sedan,
HotAirBalloon,
ArmoredHotAirBalloon,
MiniCopter,
AttackHelicopter,
TransportHelicopter,
Chinook,
RidableHorse,
WorkCart,
MagnetCrane,
SubmarineSolo,
SubmarineDuo,
Snowmobile,
TomahaSnowmobile,
Modular Vehicle Type: In your config. Is a custom type
Train components are of the following types:
Engine,
CoveredEngine,
Locomotive,
WagonA,
WagonB,
WagonC,
Unloadable,
UnloadableLoot,
UnloadableFuel,
Caboose
配置
设置和选项可以在目录下的文件中进行配置。建议使用编辑器和验证器,以避免格式问题和语法错误。VehicleLicenceconfig
经济和服务器奖励
将其用作价格。例如:"Purchase Prices": {
"scrap": { //item short name
"amount": 1000,
"displayName": "Scrap"
},
"Economics": { //use Economics
"amount": 1000,
"displayName": "Money"
},
"ServerRewards": { //use ServerRewards
"amount": 1000,
"displayName": "RP"
},
}
配置详细信息
注意:请不要将车辆的冷却时间设置为 0,因为这非常糟糕。细节{
"Settings": {
"Store Vehicle On Plugin Unloaded / Server Restart": true,
"Clear Vehicle Data On Map Wipe": false,
"Interval to check vehicle for wipe (Seconds)": 300.0, //Interval in seconds at which the plugin checks the vehicles to delete those abandoned.
"Spawn vehicle in the direction you are looking at": true,//If false, Vehicles will spawn randomly around the player
"Automatically claim vehicles purchased from vehicle vendors": false,//It will only be automatically claimed if you have purchased the vehicle license but the vehicle is not outside
"Vehicle vendor purchases will unlock the license for the player": false,//If you haven't purchased the license, it will automatically unlock it
"Limit the number of vehicles at any one time": 0,
"Prevent vehicles from damaging players": true,
"Prevent vehicles from spawning or recalling in safe zone": true,
"Prevent vehicles from spawning or recalling when the player are building blocked": true,
"Prevent vehicles from spawning or recalling when the player is mounted or parented": true,
"Check if any player mounted when recalling a vehicle": true,
"Check if any player mounted when killing a vehicle": true,
"Dismount all players when a vehicle is recalled": true,
"Prevent other players from mounting vehicle": true,
"Prevent mounting on driver's seat only": true,//Required "Prevent other players from mounting vehicle" is true
"Prevent other players from looting fuel container and inventory": true,
"Use Teams": false,//Used for "Prevent other players from mounting vehicle" and "Prevent other players from looting fuel container and inventory"
"Use Clans": true,//Used for "Prevent other players from mounting vehicle" and "Prevent other players from looting fuel container and inventory"
"Use Friends": true,//Used for "Prevent other players from mounting vehicle" and "Prevent other players from looting fuel container and inventory"
"Vehicle No Decay": false,
"Vehicle No Fire Ball": true,
"Vehicle No Server Gibs": true,
"Chinook No Map Marker": true,
"Use Raid Blocker (Need NoEscape Plugin)": false,//Use NoEscape Raid Blocker functionallity.
"Use Combat Blocker (Need NoEscape Plugin)": false//Use NoEscape Combat Blocker functionallity.
},
"Chat Settings": {
"Use Universal Chat Command": true,
"Help Chat Command": "license",
"Buy Chat Command": "buy",
"Spawn Chat Command": "spawn",
"Recall Chat Command": "recall",
"Kill Chat Command": "kill",
"Custom Kill Chat Command Prefix": "no",//usage: /nomini, /norhib, /nocha47
"Bypass Cooldown Command": "pay",//usage:: /mini pay or /spawn mini pay
"Chat Prefix": "<color=#00FFFF>[VehicleLicense]</color>: ",
"Chat SteamID Icon": 76561198924840872
},
"Normal Vehicle Settings": {//This is fixed and no new can be added
"Rowboat Vehicle": {
"Purchasable": true,//The vehicle is purchasable.
"Display Name": "Row Boat",//It will display in chat.
"Use Permission": true,
"Permission": "vehiclelicence.rowboat",
"Distance To Spawn": 5.0,
"Time Before Vehicle Wipe (Seconds)": 0.0,//0 is disabled
"Maximum Health": 0.0,//0 is disabled
"Can Recall Maximum Distance": 0.0,//0 is disabled
"Can Kill Maximum Distance": 0.0,//0 is disabled
"Minimum distance from player to recall or spawn": 3.0,//Prevent vehicles from spawning or recalling near another player
"Remove License Once Crashed": false,//If enabled, it will remove license the vehicle once crashed
"Purchase Prices": {//You can add more prices
"scrap": {
"amount": 500,
"displayName": "Scrap"
},
"economics": {
"amount": 50,
"displayName": "Money"
},
},
"Spawn Prices": {},//Similar to "Purchase Prices"
"Recall Prices": {},//Similar to "Purchase Prices"
"Recall Cooldown Bypass Prices": {},//Similar to "Purchase Prices"
"Spawn Cooldown Bypass Prices": {},//Similar to "Purchase Prices"
"Commands": [//Chat command options. e.g. "/buy row" or "/buy rowboat"
"row",
"rowboat"
],
"Spawn Cooldown (Seconds)": 300.0,//Setting it to 0 is not recommended
"Recall Cooldown (Seconds)": 30.0,//Setting it to 0 is not recommended
"Cooldown Permissions": {
"vehiclelicence.vip": {
"spawnCooldown": 150.0,
"recallCooldown": 10.0
},
"vehiclelicence.vip1": {
"spawnCooldown": 50.0,
"recallCooldown": 5.0
},
},
"Amount Of Fuel To Spawn": 0,
"Refund Fuel On Kill": true,
"Refund Fuel On Crash": true,
"Refund Inventory On Kill": true,
"Refund Inventory On Crash": true,
"Drop Inventory Items When Vehicle Recall": true
}
},
"Modular Vehicle Settings": {//This is not fixed, new ones can be added
"SmallCar": {//Modular Vehicle Type. It's up to you
"Chassis Type (Small, Medium, Large)": "Small", // Three types of chassis
"Vehicle Module Items": [//The default module for a modular vehicle
{
"shortName": "vehicle.1mod.cockpit.with.engine",//Item short name
"healthPercentage": 50.0 //Module health percentage must not be greater than 100
},
{
"shortName": "vehicle.1mod.storage",
"healthPercentage": 50.0
}
],
"Vehicle Engine Items": [//Preset engine items, add them to the engine when you spawn the vehicle
{
"shortName": "carburetor1",//Item short name
"conditionPercentage": 20.0 //Engine item condition percentage
},
{
"shortName": "crankshaft1",
"conditionPercentage": 20.0
},
{
"shortName": "piston1",
"conditionPercentage": 20.0
},
{
"shortName": "sparkplug1",
"conditionPercentage": 20.0
},
{
"shortName": "valve1",
"conditionPercentage": 20.0
}
]
}
},
"Train Vehicle Settings": {
"CompleteTrain": {
"Train Components": [ // Custom components for trains
{
"type": "Engine" // When you recall, only the first component can be recalled.
},
{
"type": "WagonA"
},
{
"type": "WagonB"
},
{
"type": "WagonC"
},
{
"type": "Unloadable"
},
{
"type": "UnloadableLoot"
}
]
}
},
}
地方化
The default messages are in the file under the directory. To add support for another language, create a new language folder (e.g. for German) if not already created, copy the default language file to the new folder and then customize the messages. VehicleLicencelang/ende
{
"Help": "These are the available commands:",
"HelpLicence1": "<color=#4DFF4D>/{0}</color> -- To buy a vehicle",
"HelpLicence2": "<color=#4DFF4D>/{0}</color> -- To spawn a vehicle",
"HelpLicence3": "<color=#4DFF4D>/{0}</color> -- To recall a vehicle",
"HelpLicence4": "<color=#4DFF4D>/{0}</color> -- To kill a vehicle",
"HelpLicence5": "<color=#4DFF4D>/{0}</color> -- To buy, spawn or recall a <color=#009EFF>{1}</color>",
"HelpBuy": "<color=#4DFF4D>/{0} {1}</color> -- To buy a <color=#009EFF>{2}</color>",
"HelpBuyPrice": "<color=#4DFF4D>/{0} {1}</color> -- To buy a <color=#009EFF>{2}</color>. Price: {3}",
"HelpSpawn": "<color=#4DFF4D>/{0} {1}</color> -- To spawn a <color=#009EFF>{2}</color>",
"HelpSpawnPrice": "<color=#4DFF4D>/{0} {1}</color> -- To spawn a <color=#009EFF>{2}</color>. Price: {3}",
"HelpRecall": "<color=#4DFF4D>/{0} {1}</color> -- To recall a <color=#009EFF>{2}</color>",
"HelpRecallPrice": "<color=#4DFF4D>/{0} {1}</color> -- To recall a <color=#009EFF>{2}</color>. Price: {3}",
"HelpKill": "<color=#4DFF4D>/{0} {1}</color> -- To kill a <color=#009EFF>{2}</color>",
"NotAllowed": "You do not have permission to use this command.",
"RaidBlocked": "<color=#FF1919>You may not do that while raid blocked</color>.",
"CombatBlocked": "<color=#FF1919>You may not do that while combat blocked</color>.",
"OptionNotFound": "This '<color=#009EFF>{0}</color>' option doesn't exist.",
"VehiclePurchased": "You have purchased a <color=#009EFF>{0}</color>, type <color=#4DFF4D>/{1}</color> for more information.",
"VehicleAlreadyPurchased": "You have already purchased <color=#009EFF>{0}</color>.",
"VehicleCannotBeBought": "<color=#009EFF>{0}</color> is unpurchasable",
"VehicleNotOut": "<color=#009EFF>{0}</color> is not out, type <color=#4DFF4D>/{1}</color> for more information.",
"AlreadyVehicleOut": "You already have a <color=#009EFF>{0}</color> outside, type <color=#4DFF4D>/{1}</color> for more information.",
"VehicleNotYetPurchased": "You have not yet purchased a <color=#009EFF>{0}</color>, type <color=#4DFF4D>/{1}</color> for more information.",
"VehicleSpawned": "You spawned your <color=#009EFF>{0}</color>.",
"VehicleRecalled": "You recalled your <color=#009EFF>{0}</color>.",
"VehicleKilled": "You killed your <color=#009EFF>{0}</color>.",
"VehicleOnSpawnCooldown": "You must wait <color=#FF1919>{0}</color> seconds before you can spawn your <color=#009EFF>{1}</color>.",
"VehicleOnRecallCooldown": "You must wait <color=#FF1919>{0}</color> seconds before you can recall your <color=#009EFF>{1}</color>.",
"NotLookingAtWater": "You must be looking at water to spawn or recall a <color=#009EFF>{0}</color>.",
"BuildingBlocked": "You can't spawn a <color=#009EFF>{0}</color> appear if you don't have the building privileges.",
"RefundedVehicleItems": "Your <color=#009EFF>{0}</color> vehicle items was refunded to your inventory.",
"PlayerMountedOnVehicle": "It cannot be recalled when players mounted on your <color=#009EFF>{0}</color>.",
"PlayerInSafeZone": "You cannot spawn or recall your <color=#009EFF>{0}</color> in the safe zone.",
"VehicleInventoryDropped": "Your <color=#009EFF>{0}</color> vehicle inventory cannot be recalled, it have dropped to the ground.",
"NoResourcesToPurchaseVehicle": "You don't have enough resources to buy a <color=#009EFF>{0}</color>. You are missing: {1}",
"NoResourcesToSpawnVehicle": "You don't have enough resources to spawn a <color=#009EFF>{0}</color>. You are missing: {1}",
"NoResourcesToRecallVehicle": "You don't have enough resources to recall a <color=#009EFF>{0}</color>. You are missing: {1}",
"MountedOrParented": "You cannot spawn or recall a <color=#009EFF>{0}</color> when mounted or parented.",
"RecallTooFar": "You must be within <color=#FF1919>{0}</color> meters of <color=#009EFF>{1}</color> to recall."
}
钩
private object CanLicensedVehicleSpawn(BasePlayer player, string vehicleType, Vector3 position, Quaternion rotation)
private void OnLicensedVehicleSpawned(BaseEntity entity, BasePlayer player, string vehicleType)
private object CanLicensedVehicleRecall(BaseEntity entity, BasePlayer player, string vehicleType, Vector3 position, Quaternion rotation)
private void OnLicensedVehicleRecalled(BaseEntity entity, BasePlayer player, string vehicleT