Forum

> > CS2D > Scripts > rawdamage in hit hook returns nil.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch rawdamage in hit hook returns nil.

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt rawdamage in hit hook returns nil.

Trotskygrad
User Off Offline

Zitieren
So I have this problem with the hit hook.

Rawdamage returns nil whenever the mp_wpndmg of a weapon is set above 99.

1
2
3
4
addhook("hit","ops.main.hit")
function ops.main.hit(id,source,weapon,hpdmg,apdmg,rawdmg)
	msg2(source,"©255000000RAW DAMAGE:"..rawdmg.."@C")
end

this works with any mp_wpndmg up to 99, but upon setting it to 100, a LUA ERROR results "attempt to concatenate local 'rawdmg' (a nil value)"

alt Re: rawdamage in hit hook returns nil.

DC
Admin Off Offline

Zitieren
Reason found. Will be fixed with the next release.
The actual problem is that the rawdmg parameter is simply not passed to the Lua call whenever a hit is lethal.

alt Re: rawdamage in hit hook returns nil.

Trotskygrad
User Off Offline

Zitieren
user DC hat geschrieben
Reason found. Will be fixed with the next release.
The actual problem is that the rawdmg parameter is simply not passed to the Lua call whenever a hit is lethal.


ah thanks, I was using rawdamage in an attempt to scale explosive damage properly in my script.

I had mp_wpndmg set to 1000 so I had the maximum granularity over the scale. Thanks for letting me know!
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht