mirror of
https://github.com/sr229/metastruct-experiments.git
synced 2024-09-20 06:30:36 +00:00
Trim out the first semicolon for the arg
This commit is contained in:
parent
ee31ad5aa8
commit
5669b9e534
1 changed files with 4 additions and 1 deletions
|
@ -9,8 +9,11 @@ hook.add("playerchat", "henkey", function(ply, txt)
|
|||
if ply ~= owner() then return end
|
||||
|
||||
if string.sub(txt, 1, 1) ~= ";" then return end
|
||||
local arg = string.sub(txt, 2)
|
||||
|
||||
bass.loadURL("https://translate.google.com/translate_tts?ie=UTF-8&q=" .. http.urlEncode(txt) .. "&tl=" .. lang .. "&client=tw-ob", "3d",
|
||||
if arg ~= nil then return end
|
||||
|
||||
bass.loadURL("https://translate.google.com/translate_tts?ie=UTF-8&q=" .. http.urlEncode(arg) .. "&tl=" .. lang .. "&client=tw-ob", "3d",
|
||||
function(a, err, name)
|
||||
-- we dispose the current reference, then we create a new one
|
||||
if soundref then soundref:stop() end
|
||||
|
|
Loading…
Reference in a new issue