mirror of
https://github.com/sergeyyarkov/altv-copchase-mod.git
synced 2026-10-11 10:19:42 +03:00
15 lines
529 B
JavaScript
15 lines
529 B
JavaScript
import alt from 'alt-server'
|
|
import { send } from 'chat'
|
|
import { isPlayerAdmin } from '../../../helpers/helpers.mjs'
|
|
|
|
import config from '../../../../config.mjs'
|
|
|
|
alt.onClient('teleportToLocation', (player, location) => {
|
|
if (!isPlayerAdmin(player)) return false
|
|
|
|
const findLocation = Object.keys(config.locations).find(_location => _location === location)
|
|
|
|
if (findLocation === undefined) return send(player, '{EE9A00}[SERVER]: {FF0000}Локация не найдена!')
|
|
|
|
player.pos = config.locations[location]
|
|
}) |