I tried but I cant , so, thx.
Forum
CS2D Scripts Lua Sound neededLua Sound needed
6 Antworten 1
I tried but I cant , so, thx.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
YOUR_ITEM_ID = 50 -- item id addhook("collect","cc") function cc(id,iid,type) 	if type = YOUR_ITEM_ID then 		parse("sv_sound fun/thats_the_way.wav") 	end end
1
parse("sv_sound2 "..id.." fun/thats_the_way.wav")
2× editiert, zuletzt 17.09.11 06:29:26
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
item_snd={} item_snd[50]="fun/thats_the_way.wav" addhook("walkover","_walkover") function _walkover(id,iid,type,ain,a,mode) 	if item_snd[tonumber(type)]~=nil then 		parse("sv_sound2 "..id.." "..item_snd[tonumber(type)]) 	end end
Now if you want to add any new sounds you can just use this syntax.
1
item_snd[item_id]="sound file"
Apache uwu hat geschrieben
I believe it's walkover, not collect. Collect means picking up primary ammo/sec.
Now if you want to add any new sounds you can just use this syntax.
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
item_snd={} item_snd[50]="fun/thats_the_way.wav" addhook("walkover","_walkover") function _walkover(id,iid,type,ain,a,mode) 	if item_snd[tonumber(type)]~=nil then 		parse("sv_sound2 "..id.." "..item_snd[tonumber(type)]) 	end end
Now if you want to add any new sounds you can just use this syntax.
1
item_snd[item_id]="sound file"
Good, Thx, but i have a problem, make a sound every time when you step on the item, it possible to have a delay. or dont do it again?
EDIT
Fixed!: I change the
1
("walkover","_walkover")
for
1
("collect","cc")
Thank you so much!
1× editiert, zuletzt 19.09.11 04:25:13
1