Forum

> > CS2D > Scripts > Gas and Molotov ignore damage?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Gas and Molotov ignore damage?

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Gas and Molotov ignore damage?

orkin2913
User Off Offline

Zitieren
Hi us, i have a problem.
I use hook "hit" to ignore damage from gas and molotov but if I go into the gas or molotov damage isn't ignored.

It look like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("hit","pyrohit")
function pyrohit(id,source,wpn,dmg)
	if wpn==72 then
		if pyro[id]==1 then
			return 1
		end
	end
	if wpn==73 then
		if pyro[id]==1 then
			return 1
		end
	end
end

alt Re: Gas and Molotov ignore damage?

EngiN33R
Moderator Off Offline

Zitieren
I just tested the code and it works perfectly. Are you sure pyro[id] is 1? Also, the code could be shortened to this:

1
2
3
4
5
6
addhook("hit","pyrohit")
function pyrohit(id,source,wpn)
	if wpn==72 or wpn==73 and pyro[id]==1 then
		return 1
	end
end

alt Re: Gas and Molotov ignore damage?

Cure Pikachu
User Off Offline

Zitieren
I had the same problem. It happens when you have too many scripts that share the same hook, especially ones that return values.

Solution: Replace
addhook("hit","pyrohit")
with
addhook("hit","pyrohit",1) -- Anything higher than 1 will do just fine.
1× editiert, zuletzt 04.03.17 18:27:02

alt Re: Gas and Molotov ignore damage?

orkin2913
User Off Offline

Zitieren
user Cure Pikachu hat geschrieben
I had the same problem. It happens when you have too many scripts that share the same hook, especially ones that return values.

Solution: Replace
1
addhook("hit","pyrohit")
to
1
addhook("hit","pyrohit",1) -- Anything higher than 1 will do just fine.

You're the best
It's works!
Yes, I make quite an advanced script and I have a lot of these hooks.
Thanks, thread to close.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht