diff --git a/server/config.mjs b/server/config.mjs index e459aad..64a9300 100644 --- a/server/config.mjs +++ b/server/config.mjs @@ -4,6 +4,14 @@ export default { y: 1123.490, z: 325.853 }, + waitingRoom: { x: 135.901, y: -749.107, z: 258.152 }, + locations: { + airport: { x: -1329.613, y: -3038.4901286875747, z: 13.938 }, + spawn: { x: 135.901, y: -749.107, z: 258.152 }, + fibroof: { x:150.126, y:-754.591, z:262.865 }, + policestation: { x:436.491, y: -982.172, z: 30.699 }, + epsilon: { x:-695.025, y: 82.955, z: 55.855 } + }, admins: [ { socialId: '370262977' } ], diff --git a/server/index.mjs b/server/index.mjs index 5cb5917..7d94fb6 100644 --- a/server/index.mjs +++ b/server/index.mjs @@ -19,6 +19,7 @@ import './modules/commands/admin/weapon.mjs' import './modules/commands/admin/tp.mjs' import './modules/commands/admin/gethere.mjs' import './modules/commands/admin/kick.mjs' +import './modules/commands/admin/location.mjs' // Player import './modules/commands/player/spawn.mjs' diff --git a/server/modules/commands/admin/location.mjs b/server/modules/commands/admin/location.mjs new file mode 100644 index 0000000..cd6deb6 --- /dev/null +++ b/server/modules/commands/admin/location.mjs @@ -0,0 +1,18 @@ +import { registerCmd, send } from 'chat' +import { isPlayerAdmin } from '../../helpers/helpers.mjs' + +import config from '../../../config.mjs' + +registerCmd('location', (player, args) => { + if (!isPlayerAdmin(player)) return send(player, `{EE9A00}[SERVER]: {FF0000}Вам недоступна эта команда!`) + + if (!args || !args[0]) { + return send(player, `{EE9A00}[SERVER]: {FFF}/location [локация]`); + } + + const findLocation = Object.keys(config.locations).find(_location => _location === args[0]) + + if (findLocation === undefined) return send(player, '{EE9A00}[SERVER]: {FF0000}Локация не найдена!') + + player.pos = config.locations[args[0]] +})