помогите решить проблему, коронка админа над головой динамическая, приближается и отдаляется при любом движении, я бы хотел ее закрепить ровно над ником, как это сделать?
JavaScript:
if (login && staticInfo) {
const position = player.getBoneCoords(12844, 0, 0, 0.1);
const screenPos = mp.game.graphics.world3dToScreen2d(position);
if (screenPos) {
const distance = mp.game.system.vdist(localPlayer.position.x, localPlayer.position.y, localPlayer.position.z, position.x, position.y, position.z);
if (distance < 15) {
if (player.getVariable('invisible') === 255) {
let positiontag;
positiontag = player.position;
mp.game.graphics.drawText(`${login} [#${staticInfo}]`, [position.x, position.y, position.z+0.4], {
scale: [0.3, 0.3],
outline: true,
color: [255, 0, 0, 255],
font: 4
});
const staticPosY = screenPos.y + 0.035;
mp.game.graphics.drawText(``, [screenPos.x, staticPosY], {
font: 0,
color: [255, 255, 255, 255],
scale: [0.35, 0.35],
outline: true
});
if (player.getVariable('voice') === true) {
const dotPosY = screenPos.y - 0.05;
mp.game.graphics.drawText('•', [screenPos.x, dotPosY], {
font: 0,
color: [255, 0, 0, 255],
scale: [0.6, 0.6],
outline: false,
centre: true
});
}
if (player.getVariable('mute') === true) {
const dotPosY = screenPos.y - 0.05;
mp.game.graphics.drawText('x', [screenPos.x, dotPosY], {
font: 0,
color: [255, 0, 0, 255],
scale: [0.6, 0.6],
outline: false,
centre: true
});
}
if (adminlvl >= 1 && radname === true) {
const crownPosY = screenPos.y - 0.03;
mp.game.graphics.drawSprite('redage_textures_001', 'admin', screenPos.x, crownPosY, 0.027, 0.027, 0, 255, 255, 255, 255);
}