Forum

> > CS2D > Scripts > Sound on equip for all or ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Sound on equip for all or ?

30 replies
Page
To the start Previous 1 2 Next To the start

old Sound on equip for all or ?

Rainoth
Moderator Off Offline

Quote
I'm currently making "special" armors for my server and this might be quite a dumb question but :
Is armor equip sound heard for everyone or for the only player who equips ?

old Re: Sound on equip for all or ?

Rainoth
Moderator Off Offline

Quote
Is it possible to use "sv_sound" so only people around would hear it ? Or only possible for all to hear ? (It would be quite hard to check if each player stands at the room tiles and only then to play sv_sound2 to him)

old Re: Sound on equip for all or ?

Deleted User

Quote
Quote
Is it possible to use "sv_sound" so only people around would hear it ?

Wtf man, it's already like that!

old Re: Sound on equip for all or ?

Yates
Reviewer Off Offline

Quote
@user Infinite Rain: You should seriously consider getting your eyes checked as you obviously don't know how to read.

@user Rainoth: You have two solutions as to letting people hear the equip sound for your "special armour". One; use the armour item (And then remove it, setarmour 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.

old Re: Sound on equip for all or ?

Alistaire
User Off Offline

Quote
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.

old Re: Sound on equip for all or ?

Yates
Reviewer Off Offline

Quote
user Alistaire has written
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.

old Re: Sound on equip for all or ?

Rainoth
Moderator Off Offline

Quote
user Yates has written
@user 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.

old Re: Sound on equip for all or ?

Deleted User

Quote
Damn, sorry for being dumb.

@user Rainoth:
or you can use this function to check if player in radius
1
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

old Re: Sound on equip for all or ?

Rainoth
Moderator Off Offline

Quote
user Yates has written
@user 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.

old Re: Sound on equip for all or ?

Alistaire
User Off Offline

Quote
user Rainoth has written
user Yates has written
@user 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

old Re: Sound on equip for all or ?

Avo
User Off Offline

Quote
@user Rainoth: Same with aeroplane/airplane, colour/color, analyse/analyze, centre/center, honour/honor, realise/realize, aluminium/aluminum and many more...

old Re: Sound on equip for all or ?

Rainoth
Moderator Off Offline

Quote
1
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 ?

old Re: Sound on equip for all or ?

Yates
Reviewer Off Offline

Quote
1
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?

old Re: Sound on equip for all or ?

Rainoth
Moderator Off Offline

Quote
user Yates has written
user Infinite Rain has written
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.

old Re: Sound on equip for all or ?

Alistaire
User Off Offline

Quote
1
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
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].

old Re: Sound on equip for all or ?

Rainoth
Moderator Off Offline

Quote
user Alistaire has written
1
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
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
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview