Skip to content

Commit e359577

Browse files
Merge pull request #109 from BPEssentials/DestroyVehicle
Add DestroyVehicle Command
2 parents 13b01b8 + 8409fa4 commit e359577

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

dist/localization.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"player_vehicle_locked": "You have locked your {0}.",
7171
"player_vehicle_repaired": "Repaired {0}.",
7272
"player_vehicle_spawned": "Spawned {0}.",
73+
"player_vehicle_destroyed": "Destroyed {0}.",
7374
"player_give": "Gave {0} {2} {1}.",
7475
"discord": "Our Discord: {0}",
7576
"all_warned": "{0} warned {1} for {2}",

dist/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@
319319
"rv"
320320
]
321321
},
322+
{
323+
"CommandName": "DestroyVehicle",
324+
"Commands": [
325+
"destroyvehicle",
326+
"dv"
327+
]
328+
},
322329
{
323330
"CommandName": "Discord",
324331
"Commands": [
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using BPEssentials.Abstractions;
2+
using BPEssentials.ExtensionMethods;
3+
using BrokeProtocol.Entities;
4+
5+
namespace BPEssentials.Commands
6+
{
7+
public class DestroyVehicle : BpeCommand
8+
{
9+
public void Invoke(ShPlayer player)
10+
{
11+
var vehicle = player.curMount as ShTransport;
12+
if (vehicle == null)
13+
{
14+
player.TS("player_notInVehicle");
15+
return;
16+
}
17+
vehicle.Destroy();
18+
player.TS("player_vehicle_destroyed", vehicle.name);
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)