mirror of
https://github.com/sergeyyarkov/altv-copchase-mod.git
synced 2026-10-11 10:19:42 +03:00
19 lines
686 B
JavaScript
19 lines
686 B
JavaScript
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]]
|
|
})
|