Is armor equip sound heard for everyone or for the only player who equips ?
Forum




Sound on equip for all or ?
30 repliesIs armor equip sound heard for everyone or for the only player who equips ?
Re: Sound on equip for all or ?
Deleted User
Re: Sound on equip for all or ?
Deleted User Quote
Is it possible to use "sv_sound" so only people around would hear it ?
Wtf man, it's already like that!

@


If you know the range +/-, you could make a function, which returns the other's x and y and yours, to calculate a length. With the length you could change the volume depending on how far someone's away.
That's something that he doesn't want to do.

@
Rainoth:Use the armor* item (And then remove it, setarmor* to 0 will do the trick) as CS2D will automatically let the people around you hear the sound or two; use the sv_sound2 if people are close enough.

For this. I thank you a lot, Yates.

Re: Sound on equip for all or ?
Deleted User@

or you can use this function to check if player in radius
1
2
3
2
3
playerInRadius(id, x, y, radius) 	return math.sqrt((x - player(id, 'x')^2 + (y - player(id, 'y')^2) <= radius end
Will return false if player is not in the radius, and true if he is

@
Rainoth: No problem, but I am British - so for me it's armour. No need to correct me there as we all understand.

O.O Really ? I didn't know that it was different for British and American. Sorry for that.

> Armor, color, flavor, harbor, honor, humor, labor, neighbor, rumor
> Armour, colour, flavour, harbour, honour, humour, labour, neighbour, rumour

1
2
3
4
5
6
2
3
4
5
6
addhook("ms100","noarmour") function noarmour() 	if (noarmor[id]==1) then 		parse("setarmor "..id.." 0") 	end end
What is wrong here ? Armor that gives regen is working but the "noarmour" (used british word hehe) isn't working. Is it true because setarmor uses "..id.." ? How do I fix it then ?
1
2
2
for _,all in pairs(player(0,"table")) do 	if noarmor[all]==1 then
I actually suggest you not use ms100 hook. What are you trying to accomplish by stripping armour?
Re: Sound on equip for all or ?
Deleted User
why dont you just equip random armor and strip it instantly?
This.


why dont you just equip random armor and strip it instantly?
This.
Whatcha mean ? How can you strip armor ?
Why I need this stuff.
I made ~8 different images that show armors.
When player is in ct base and goes to armor room he can choose between 10 different armors. If he get's any kind of armor he can't get any more. There are 8 armors that are scripted so when player steps on tilex tiley he gets armor's effect except Kevlar & Helm AND Stealth suit. What I want is so that when one of the players get's those special armors and TRIES to take kevlar helm or stealth suit. His armor is set to 0 because he already has special power from the armor he chose to take.
1
2
3
4
5
2
3
4
5
function AA_armoursound(id) 	local prev = player(id, 'armor') 	parse('setarmor '..id..' 201') 	timer(1, 'parse', 'setarmor '..id..' '..prev) end
Just add AA_armorsound wherever you want armour equip sound..
----
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
function AA_checkarmour(id) 	if armourtable[id] > 0 then 		return 1; 	end end function AA_walkover(id, iid) 	if iid == 57 or iid == 58 or (iid >= 79 and iid <= 84) then 		return AA_checkarmour(id); 	end end
To return 1 (don't pick up) if the player armour table (or whatever you have) is 1 for that player. You should prolly replace the armourtable[id].

1
2
3
4
5
2
3
4
5
function AA_armoursound(id) 	local prev = player(id, 'armor') 	parse('setarmor '..id..' 201') 	timer(1, 'parse', 'setarmor '..id..' '..prev) end
Just add AA_armorsound wherever you want armour equip sound..
----
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
function AA_checkarmour(id) 	if armourtable[id] > 0 then 		return 1; 	end end function AA_walkover(id, iid) 	if iid == 57 or iid == 58 or (iid >= 79 and iid <= 84) then 		return AA_checkarmour(id); 	end end
To return 1 (don't pick up) if the player armour table (or whatever you have) is 1 for that player. You should prolly replace the armourtable[id].
As far as I believe this should work.. I don't understand it. Could you explain it ?
I also wanted to learn how to use timers so I could make stuff like slowing for few seconds or so..
Edit : Nvm. I learned the timers myself. Still need to make some simple hook/function that isn't long to strip players armor. Most understandable way is probably best..
edited 1×, last 06.03.13 08:27:08 pm