Forum
CS2D Scripts How can I create this script?How can I create this script?
5 replies 1
1
2
3
4
5
6
7
8
9
10
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
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.
"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 @ Mora: was nicer than me)
VaiN has written
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 @ Mora: was nicer than me)
"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 @ Mora: was nicer than me)
ok
1