added location command

This commit is contained in:
Sergey Yarkov 2020-08-06 00:26:23 +03:00
parent 2f4c89a8db
commit 298a7bd6df
3 changed files with 27 additions and 0 deletions

View File

@ -4,6 +4,14 @@ export default {
y: 1123.490, y: 1123.490,
z: 325.853 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: [ admins: [
{ socialId: '370262977' } { socialId: '370262977' }
], ],

View File

@ -19,6 +19,7 @@ import './modules/commands/admin/weapon.mjs'
import './modules/commands/admin/tp.mjs' import './modules/commands/admin/tp.mjs'
import './modules/commands/admin/gethere.mjs' import './modules/commands/admin/gethere.mjs'
import './modules/commands/admin/kick.mjs' import './modules/commands/admin/kick.mjs'
import './modules/commands/admin/location.mjs'
// Player // Player
import './modules/commands/player/spawn.mjs' import './modules/commands/player/spawn.mjs'

View File

@ -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]]
})