Forum

> > CS2D > Scripts > What errors on my script?
Forums overviewCS2D overview Scripts overviewLog in to reply

English What errors on my script?

4 replies
To the start Previous 1 Next To the start

old What errors on my script?

sonkii
User Off Offline

Quote
Hi us , i am starting to making a script but,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook("endround""end_of_round")

function ctwin()
	msg("Counter Terrorist has stopped Terrorist from the target!")
	parse("sv_sound \"cscz/ct_win.wav\"")
end

function twin()
	msg("Counter Terrorist failed protect the Terrorist target from them!")
	parse("sv_sound \"cscz/t_win.wav\"")
end


function end_of_round(mode)
     if mode==1 then --Regular T win
          twin()
     elseif mode==2 then --Regular CT win
          ctwin()
     elseif mode==60 then --All humans infested; Zombies win
          twin()
     elseif mode==61 then --Humans survived; Humans win
          ctwin()
     end
end

And in-game it show sv_sound error

1
ERROR: cannot play sound 'sfx/cscz/ct_win.wav' - failed to load (sv_sound)

Even i have that file,still error.Any solution?

old Re: What errors on my script?

Masea
Super User Off Offline

Quote
I can't see the error actually. Are you confident that file in the correct place? And make sure If It's .ogg or .wav. Otherwise, try that;
1
parse("sv_sound cscz/ct_win.wav")

old Re: What errors on my script?

GeoB99
Moderator Off Offline

Quote
From your code, I don't see anything issue-code related, everything is fine in terms of syntax. I assume the file inside cscz folder is corrupt and not playable because of this. Can you play them through a media player like MS's Media Player one?

old Re: What errors on my script?

Masea
Super User Off Offline

Quote
Sometimes, I met a problem about sounds. The problem is, even file type is .wav the cs2d can't play that for some reason. Then, I transform that file again to .wav type via http://online-audio-converter.com/

Do what user GeoB99, said. If the Media Player plays that correctly, then try it on the cs2d map editor. If It doesn't work on the editor, so do what I said.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview