Hello everyone,
I am making my own map and i have some problems there, but i know that its will solve for using a script there, i'm Sure...
I'm not defining my map problem, k?
I'm directly gotta ask and request.
I want play sound on a tile, when we move those tiles so when a play a sound, but its happen with Counter-Terrorist force.tiles position: i have 2 tiles there i want play sound, and when counter-terrorists move those tiles so play another sound.
Tiles Positions:121|88,122|88
Please help me for this script
Thanks Admin/mod comment
"Script needed" is a bad title. Please describe what you want next time. Fixed. /DC DC Admin Offline
This can also be done with the map editor only. Without script.s
Put trigger_move entities on the tiles you want to trigger sounds with, you can enable "CTs only" if you only want CTs to trigger sounds
Create env_sound entities and cofigure them for the sounds
Give your env_sound entities names
Link the env_sound entities to your trigger_move entities by entering the names of the env_sound entities in the trigger field of the corresponding trigger_move entity idk if it would work. Just the simple and quick thing:
Idk which sound type you exactly want, so i made two
1
2
3
4
5
6
7
addhook("movetile","_movetile")
function _movetile(id,x,y)
	if (x==121 or x==122) and y==88 then
		-- parse('sv_soundpos '..(x*32)..' '..(y*32)..' "soundfile'..player(id,"team")..'.ogg" '..id)
		-- parse('sv_sound2 '..id..' "soundfile'..player(id,"team")..'.ogg"')
	end
end
You can name your files like:
path/sound1.ogg
and path/sound2.ogg
and if player team is 1 (tt) will be played sound1.ogg and if player team is 2 (ct) will be player sound 2.ogg
Didnt test it and wont do that. @ DC: ,
But its not possible, We can put 2 (Others) Trigger_Move over one tile, i want when (T) Move Those tiles so play other sound and (CT) move those tiles so play other sound.
Not only for Cts, here mainly use a script.
________________
@ Mora: I really didn't understand what really you said, Read My thread for asking script again please.
Thnaks @ Man Of Steel: i did exactly what you want. You're never fucking concrete with your questions!
There is tested version.
1
2
3
4
5
6
7
addhook("movetile","_movetile")
function _movetile(id,x,y)
	if (x==2 or x==3) and y==2 then
		-- parse('sv_soundpos '..(x*32)..' '..(y*32)..' "soundfile'..player(id,"team")..'.ogg" '..id)
		parse('sv_sound2 '..id..' "soundfile'..player(id,"team")..'.ogg"')
	end
end
Change x and y and decide which sound type you want and then make a path with your sounds. Name them like:
sound1.ogg (or wav, so you'd need to change ogg to wav in lua), it will be TT sound
and sound2.ogg (or wav, you'd again need to change ogg to wav in this lua), it will be CT sound. Compulsory question are below,
@ Mora:, where i will be write Tiles Position?
________________________________
And you means, i change x,y to my Sound path folder name ?, can you give me example, i'm confuse.
Mora_rus has written
function _movetile(id,x,y)
Our sounds when cts and tt are move so play sounds are:
For Cts: sfx/!jail sounds/Weapons_OFF.wav
For tt: sfx/!jail sounds/Weapons_OFF.wav
Tile Position, there i wants to play both sound:
121|88
@ Mora: Don't Rage, i'm nab anyways
Please help a nab, but read my compulsory question plz Version for people with low iq:
1
2
3
4
5
6
7
8
9
10
addhook("movetile","_movetile")
function _movetile(id,x,y)
	if (x==121 or x==122) and y==88 then
		if player(id,"team")==1 then
			parse('sv_sound2 '..id..' "sfx/!jail sounds/Weapons_OFF.wav"')
		else
			parse('sv_sound2 '..id..' "sfx/!jail sounds/Weapons_OFF.wav"')
		end
	end
end
change the path, after if player(id,"team")==1 then
you see path for TT (5 line), after else
you see path for CT (7 line) @ Mora: Listen, There no playing sound after moving ct and tt. However, there unbelievable silence, what you said about changing some line, in your below quote?
Mora_rus has written
change the path, after if player(id,"team")==1 then you see path for TT (5 line), after else you see path for CT (7 line)
Can i say fuck you, please?
your path is incorrect, there should be no "sfx/!jail sounds/Weapons_OFF.wav" but "!jail sounds/Weapons_OFF.wav"
1
2
3
4
5
6
7
8
9
10
addhook("movetile","_movetile")
function _movetile(id,x,y)
if (x==121 or x==122) and y==88 then
if player(id,"team")==1 then
parse('sv_sound2 '..id..' "!jail sounds/Weapons_OFF.wav"')
else
parse('sv_sound2 '..id..' "!jail sounds/Weapons_OFF.wav"')
end
end
end
Mr.@ Mora: , Can i say Fuck you too?
You mistake again,
I said you: when Terrorist Move those Tiles so Play "weapons On" sound and Counter-Terrorist Move so play "Weapon off" sound, dude
please change this your mistake///
By the i wants to change Tile Position who i was gave you.
Please Change (x,y)Tile Set Position to 154|102,
If you do that, so over Work is successfully done it. @ Man Of Steel: Stop using translate. I don't understand, nor people do. Man Of Steel has written
Mr.@
Mora: , Can i say Fuck you too?
You mistake again,
I said you: when Terrorist Move those Tiles so Play "weapons On" sound and Counter-Terrorist Move so play "Weapon off" sound, dude
please change this your mistake///
By the i wants to change Tile Position who i was gave you.
Please Change (x,y)Tile Set Position to 154|102,
If you do that, so over Work is successfully done it.
No! Is all over. I'd never watch your threads again. Bye This should work
1
2
3
4
5
6
addhook('movetile','movetile_hook')
function movetile_hook(id,x,y)
	local s1 = Yourpath/sound
	parse("sv_sound2 "..s1)
	return 1
end
Good luck. If you want to achieve that in map, all you have to do is make trigger_move trigger 2 trigger_if entities both checking different teams. You don't need scripts if its only for that one map. @ Mora: Okay fine,
@ Masea: : By the way i'm not Using Translator, my English is sucks anyways.
Okay Guys no problem i'm try to solve this problem myself.
Thanks for your works.