Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос [NL] Помощь с воспроизведением звука

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
25 Янв 2022
Сообщения
65
Реакции
19
Всем здравствуйте, возникла проблема с тем что не воспроизводится звук при выстреле, если кто поможет за ранее спасибо.

Sound:
Expand Collapse Copy
local csgo_weapons = require("neverlose/csgo_weapons")
local select_tab = ui.create("Main", "Select Sound Version")
local enable = select_tab:switch("Enable")
local sound_volume = select_tab:slider("Sound Volume", 0, 100, 50)
local function get_weapon()
    local local_player = entity.get_local_player()
    local weapon_ent = entity.get_player_weapon(local_player)
    if weapon_ent == nil then return end
    local weapon = csgo_weapons(weapon_ent)
    return weapon.name
end
events.aim_fire:set(function(e)
local me = entity.get_local_player()
if not me or not me:is_alive() then return end
if enable:get() then
local cur_weapon = get_weapon():gsub("%s+", "") or nil
local cur_vol = (" " ..sound_volume:get()/100)
utils.console_exec("playvol weapon_sound/"..cur_weapon..cur_vol)
    end
end)
 
code_language.lua:
Expand Collapse Copy
ffi_handler.sound_client = ffi.cast("uintptr_t**", Utils.CreateInterface("engine.dll", "IEngineSoundClient003"))
ffi_handler.play_sound = ffi_handler.__thiscall(ffi.cast("void*(__thiscall*)(void*, const char*, float, int, int, float)", ffi_handler.sound_client[0][12]), ffi_handler.engine_sound_client)

ffi_handler.play_sound("buttons/arena_switch_press_02.wav", volume / 100, 100, 0, 0)

Вообще воспроизводить звуки выстрелов сам по себе костыль
 
1694414059224.png
 
Назад
Сверху Снизу