This is a mobile optimized page that loads fast, if you want to load the real page, click this text.

Вопрос Этикетка над головой RA3

BooyaK

Новый участник
20 Янв 2022
22
2
47
Привет. В сборке RedAge V3 я бы хотел, чтобы мне также был виден ник над головой персонажа (моего персонажа). Я пытался что-то сделать, но безуспешно. XD Я думал, может быть, это такой код:
JavaScript:
gm.events.add("render", () => {
    if (!global.loggedin) return;
    else if (!global.showhud) return;

    if (markerToPlayer)
        markerToPlayer.destroy(),
        markerToPlayer = null;

    if (global.entity && (!global.entity.doesExist() || global.entity['INVISIBLE'] || mp.game.gameplay.getDistanceBetweenCoords(global.entity.position.x, global.entity.position.y, global.entity.position.z, localplayer.position.x, localplayer.position.y, localplayer.position.z, true) > 6.0)) {
        //global.entity = null;

        GetLooking ();
        return;
    }

    //

    /*
    if (global.circleOpen) {
        global.UpdateCircle (global.entity);
        return;
    }
    */

const myPlayerName = "${player.name}";

    //

    if (global.entity) {
        const type = global.entity.type;
        const position = global.entity.position;

        if (type == "player") {
            if (global.localplayer.isInAnyVehicle(false)) {
                mp.game.graphics.drawText(global.Keys[global.userBinder[32].keyCode], [position.x, position.y, position.z], {
                    font: 0,
                    color: [255, 255, 255, 185],
                    scale: [0.4, 0.4],
                    outline: true
                });
            } else {
                const fractionID = 0;
                let markerRotation = 380;

                markerToPlayer = mp.markers.new(27, new mp.Vector3(position.x, position.y, position.z - 0.975), 1, {
                    'rotation': new mp.Vector3(0, 0, markerRotation),
                    'color': [
                        colorsData[fractionID][0],
                        colorsData[fractionID][1],
                        colorsData[fractionID][2],
                        185
                    ],
                    'visible': true,
                    'dimension': global.localplayer.dimension
                });

                if (position.equals(global.localplayer.position)) {
                    // Wyświetl twój nick gracza
                    mp.game.graphics.drawText(myPlayerName, [position.x, position.y, position.z + 0.5], {
                        font: 0,
                        color: [255, 255, 255, 185],
                        scale: [0.4, 0.4],
                        outline: true
                    });
                } else {
                    // Wyświetl nazwę innego gracza
                    mp.game.graphics.drawText(global.Keys[global.userBinder[31].keyCode], [position.x, position.y, position.z], {
                        font: 0,
                        color: [255, 255, 255, 185],
                        scale: [0.4, 0.4],
                        outline: true
                    });
                }
            }
        } else if (global.entity.type == "vehicle" && global.entity != localplayer.vehicle) {
            mp.game.graphics.drawText(global.Keys[global.userBinder[31].keyCode], [position.x, position.y, position.z], {
                font: 0,
                color: [255, 255, 255, 185],
                scale: [0.4, 0.4],
                outline: true
            });
        } else if (global.entity.type == "object") {
            if (global.entity !== focusObject) {
                global.GetItemData(global.entity);
                focusObject = global.entity;
            } else {
                mp.gui.emmit(`window.hudItem.dropFocus ()`);
            }

            if (global.entity['dropData'] && (global.entity['dropData'].pId != undefined || global.entity['dropData'].fId != undefined)) {
                let textKey = global.Keys[global.userBinder[31].keyCode];

                if (global.isAdmin && global.entity['dropData'].pId != undefined) {
                    const player = mp.players.atRemoteId(global.entity['dropData'].pId);
                    if (player) {
                        textKey += `\n(( ${player.name} ))`
                    }
                }

                mp.game.graphics.drawText(textKey, [position.x, position.y, position.z], {
                    font: 0,
                    color: [255, 255, 255, 185],
                    scale: [0.4, 0.4],
                    outline: true
                });
            } else {
                mp.game.graphics.drawText(global.Keys[global.userBinder[32].keyCode], [position.x, position.y, position.z], {
                    font: 0,
                    color: [255, 255, 255, 185],
                    scale: [0.4, 0.4],
                    outline: true
                });
            }
        }
    }
});

Я рассчитываю на вашу помощь !
 

Similar threads