Forum

> > CS2D > Scripts > sv_stopsound to id doesn't works
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch sv_stopsound to id doesn't works

18 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt sv_stopsound to id doesn't works

Promaster
User Off Offline

Zitieren
SV_Stopsound

Sv_Stopsound doesn't work for "id"!
I had a SV_sound2 file open, i couldn't stop the sound for one id player. But the Sv_Stopsound for the whole server works (when i trigger sv_stopsound without puting any id after the sound file name)!

Idk if i am doing it wrong or can someone help me?

1
2
3
4
5
6
7
8
9
10
11
addhook("use","testuse")
function testuse(id,event,data,x,y)
		parse("sv_sound2 " .. id .. " Lunia/BossWarning_Drake.ogg")
end


addhook("flashlight","Testflash")
function Testflash(id)
		parse("sv_stopsound  Lunia/BossWarning_Drake.ogg " .. id .. "")
		print("Triggered")
end

The print triggers but the sounds doesn't stop for my id when i flashlight

alt Re: sv_stopsound to id doesn't works

BcY
Reviewer Spielt CS2D

Zitieren
I tested it with both ways. It looks like it's not working with id.(stopsound)

1
2
3
4
5
6
7
8
9
10
11
addhook("use","testuse")
function testuse(id,event,data,x,y)
          parse("sv_sound2 "..id.." menu.wav")
end


addhook("flashlight","Testflash")
function Testflash(id)
          parse("sv_stopsound menu.wav")
          print("Triggered")
end
This one is working.

alt Re: sv_stopsound to id doesn't works

DC
Admin Off Offline

Zitieren
Yes, I think there is a bug with it and I also think that it already has been reported before. I didn't check it myself yet and we did not fix anything related to this in 1.0.0.3.

alt Re: sv_stopsound to id doesn't works

Masea
Super User Off Offline

Zitieren
@user Mami Tomoe: Do you even know what is that function for? You were probably using it for timer when you actually don't know how to use. We use that function for transforming the numbers which are in strings to completely numbers. Maybe we can use that for anything else but this is the only thing I know so far.
1
2
local s = "3"
local ss = tonumber(s) >> 3
You can use tostring either.
1
2
local s = 3
local ss = tostring(s) >> "3"

alt Re: sv_stopsound to id doesn't works

DC
Admin Off Offline

Zitieren
It does hurt. It's basically waste of performance, even if the impact is absolutely negligible.

user Masea and user Waldin are right. It will not help. Converting something to a number just to convert it back to a string in the next step can't change anything. You don't even need to try because logic tells us that it can't work.

tonumber makes sense for the cs2d lua cmd game command but it never makes sense when you use the value directly (without using mathematical operations first) in cs2d lua cmd parse because parse operates on a string anyway.

alt Re: sv_stopsound to id doesn't works

Masea
Super User Off Offline

Zitieren
@user Mami Tomoe: We don't need to try that if we already know what's gonna happen

Oh guys, really? This is the first time that I examined the thread itself carefully and entirely and can't believe in you who couldn't fix this thingy already Here it is, boy:
parse('sv_stopsound "Lunia/BossWarning_Drake.ogg" '..id)


Lmao, neither there is a bug, nor user Promaster knows how to use that command, so does user DC. It fucking surprised me.
1× editiert, zuletzt 16.05.17 21:28:28

alt Re: sv_stopsound to id doesn't works

Masea
Super User Off Offline

Zitieren
@user Mami Tomoe: Trust me it's not. When we're going to stop a sound, we'd absolutely specify a sound since that command is mostly and actually fully about sound. But ID parameter is up to people, they may want or not.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht