Forum

> > CS2D > Scripts > How can I create this script?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How can I create this script?

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: How can I create this script?

Mora
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
typesounds={
[30]="weapons/airstrike.ogg",
[32]="weapons/barbedwire.ogg"
}
addhook("hit","_hit")
function _hit(id,source,weapon,hpdmg,apdmg,rawdmg)
	if typesounds[weapon] then
		parse('sv_soundpos "'..typesounds[weapon]..'" '..player(id,"x")..' '..player(id,"y"))
	end
end
Try this, seems it working for me.
Oh btw, to make this script you need hit hook. ID is player who being hit by SOURCE. So im using
player(id,"y")
to parse this sounds related to his position. WEAPON is weapon of player who hit ID.
Table is made specially to recognize which weapon have which sound to be played when hit.

You can see yourself, add your weapon id in squarebrackets and set a path w/o "sfx" included.

alt Re: How can I create this script?

VaiN
User Off Offline

Zitieren
Since your topic has such a vague title, I feel compelled to give you the obvious answer.

"How can I create this script?"

If you are asking us this question, instead of yourself, then you're doing it wrong.



And don't forget to ask the documentation too.

(At least @user Mora: was nicer than me)

alt Re: How can I create this script?

light and gaia
User Off Offline

Zitieren
user VaiN hat geschrieben
Since your topic has such a vague title, I feel compelled to give you the obvious answer.

"How can I create this script?"

If you are asking us this question, instead of yourself, then you're doing it wrong.



And don't forget to ask the documentation too.

(At least @user Mora: was nicer than me)


ok
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht