Skip to content

Commit 3521d2a

Browse files
committed
Refuse to spawn trains using the /v feature
1 parent 50cdb4f commit 3521d2a

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

data/messages.json

+1
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@
603603
"VEHICLE_SEIZED": "@success You've seized the vehicle, on you go.",
604604
"VEHICLE_SPAWN_CREATED": "@success Your %s has been created!",
605605
"VEHICLE_SPAWN_NOT_ALLOWED": "@error You are not allowed to spawn vehicles right now.",
606+
"VEHICLE_SPAWN_NOT_ALLOWED_TRAIN": "@error You are unable to create trains using this feature.",
606607
"VEHICLE_SPAWN_NOT_FOUND": "@error We're not sure what vehicle {FF8282}%s{FFFFFF} is...",
607608
"VEHICLE_SPAWN_REJECTED": "@error Sorry, you can't spawn vehicles right now because %s.",
608609
"VEHICLE_UNLOCK_PASSENGER": "@error You can only unlock a vehicle when you're the driver!",

javascript/features/streamer/streamable_vehicle_info.js

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export class StreamableVehicleInfo {
2828
if (typeof modelId !== 'number' || modelId < 400 || modelId > 611)
2929
throw new Error(`Invalid vehicle model Id given: ${modelId}`);
3030

31+
if ([ 537, 538 ].includes(modelId))
32+
throw new Error(`Illegal to dynamically create trains through this system.`);
33+
3134
if (!(position instanceof Vector))
3235
throw new Error(`Invalid vehicle position given: ${position}`);
3336

javascript/features/vehicles/vehicle_commands.js

+5
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ class VehicleCommands {
227227
return;
228228
}
229229

230+
if ([ 537, 538 ].includes(vehicleModel.id)) {
231+
player.sendMessage(Message.VEHICLE_SPAWN_NOT_ALLOWED_TRAIN);
232+
return;
233+
}
234+
230235
const streamableVehicle = this.manager_.createVehicle(player, vehicleModel.id);
231236
if (!streamableVehicle) {
232237
player.sendMessage(Message.VEHICLE_SPAWN_NOT_ALLOWED);

0 commit comments

Comments
 (0)