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

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

Sound:
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)
 
Nike.lua
Олдфаг
Статус
Оффлайн
Регистрация
13 Окт 2020
Сообщения
2,747
Реакции[?]
1,465
Поинты[?]
2K
code_language.lua:
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)
Вообще воспроизводить звуки выстрелов сам по себе костыль
 
c:\buildworker\csgo_rel_win64
Участник
Статус
Оффлайн
Регистрация
18 Окт 2022
Сообщения
592
Реакции[?]
212
Поинты[?]
140K
Есть ещё EmitAmbientSound, в нём ещё и громкость регуливаровать можно
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Сверху Снизу