mp.events.add('playerQuit', player => {
const marker = mp.markers.new(
42,
new mp.Vector3(
player.position.x,
player.position.y,
player.position.z,
),
1,
{
dimension: 0,
color: [255, 165, 0, 20],
rotation: new mp.Vector3(0.0, 0.0, 0.0),
visible: true,
},
)
const currentTime = new Date()
const hours = currentTime.getHours().toString().padStart(2, '0')
const minutes = currentTime.getMinutes().toString().padStart(2, '0')
const seconds = currentTime.getSeconds().toString().padStart(2, '0')
const formattedTime = `${hours}:${minutes}:${seconds}`
const label = mp.labels.new(
`Игрок: ${player.name} | Время выхода: ${formattedTime}`,
new mp.Vector3(
player.position.x,
player.position.y,
player.position.z + 0.5,
),
{
los: true,
font: 1,
drawDistance: 100,
},
)
setTimeout(
() => {
marker.destroy()
label.destroy()
},
3 * 60 * 1000,
)
})