bool result, table colPoint = processLineOfSight(float originX, float originY, float…
- User
bool result, table colPoint = processLineOfSight(float originX, float originY, float originZ, float targetX, float targetY, float targetZ, [bool checkSolid=true], [bool car=false], [bool ped=false], [bool object=false], [bool particle=false], [bool seeThrough=false], [bool ignoreSomeObjects=false], [bool shootThrough=false])
используя эту функцию добавь проверку на препятствие перед неймтегом и не рендери ево если препятствие есть
-- Hook for Customizing EndHealthBar local function endHealthBarHook(playerTags) destroyDefined3DTexts()
codelocal charX, charY, charZ = getCharCoordinates(playerPed) local limbX, limbY, limbZ = getBodyPartCoords(8, playerPed) local cameraX, cameraY, cameraZ = getActiveCameraCoordinates() local cameraDistance = getDistanceBetweenCoords3d(charX, charY, charZ, cameraX, cameraY, cameraZ) local success, playerId = sampGetPlayerIdByCharHandle(playerPed) if not success then return EndHealthBar(playerTags) end local nickname = sampGetPlayerNickname(playerId) local color = sampGetPlayerColor(playerId) + 0xFF000000 local text = string.format("%s (%d)", nickname, playerId) local offset = alignVerticalOffset(measureTextSize(text).cy) position.x, position.y, position.z = limbX, limbY, limbZ local health = sampGetPlayerHealth(playerId) local armor = sampGetPlayerArmor(playerId) drawHealthBar(playerTags, position, health, armor, cameraDistance) limbZ = limbZ + 0.21 + ((cameraDistance * 0.047499999) * offset) local limbZ2 = limbZ + ((cameraDistance * 0.047499999) * offset) / 2 sampCreate3dTextEx(NICKNAME_ID, text, color, limbX, limbY, limbZ, SAMP_TEXT_DISTANCE, false, -1, -1) sampCreate3dTextEx(BUBBLE_ID, "{d0aeeb} * смотрите, я ролевик", 0xFFFFFFFF, limbX, limbY, limbZ2, SAMP_TEXT_DISTANCE, false, -1, -1) return EndHealthBar(playerTags)end
- Assistant
To ensure that a name tag isn't rendered if there's an obstacle between the player and the target, you can utilize the function before rendering the text. Here's how you can incorporate this check into your code: