--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
AddCSLuaFile()
local voxPacks = {}
function registerVox(name, tbl)
voxPacks[name] = tbl
end
if CLIENT then
concommand.Add("pk_pill_voxmenu", function(ply, cmd, args, str)
if pk_pills.getMappedEnt(ply) and pk_pills.getMappedEnt(ply).formTable.voxSet then
local voiceMenuSrc = [[
PillVox
]]
local html = vgui.Create("DHTML", panel)
html:SetPos(10, ScrH() / 6)
html:SetSize(300, ScrH() * (2 / 3))
html:SetAllowLua(true)
html:SetHTML(voiceMenuSrc)
html:RunJavascript("init(" .. util.TableToJSON(voxPacks[pk_pills.getMappedEnt(ply).formTable.voxSet]) .. ")")
html:MakePopup()
end
end)
else
concommand.Add("pk_pill_vox", function(ply, cmd, args, str)
if pk_pills.getMappedEnt(ply) and pk_pills.getMappedEnt(ply).formTable.voxSet then
pk_pills.getMappedEnt(ply):EmitSound(voxPacks[pk_pills.getMappedEnt(ply).formTable.voxSet][args[1]])
end
end)
end