Forum

> > CS2D > Scripts > How does the bomb explode hook work?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How does the bomb explode hook work?

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt How does the bomb explode hook work?

Mami Tomoe
User Off Offline

Zitieren
I couldn't find enough information about it, but how does the cs2d lua hook bombexplode hook work?

The player parameter to be precise, is what I'm asking.

What happens if the player that planted the bomb leaves the game?
Will it still send their ID, or will it not call it at all? Or perhaps, it will send
0
?

Thank you.

alt Re: How does the bomb explode hook work?

DC
Admin Off Offline

Zitieren
That hook is always called. Even if the bomb planter left and even if the bomb item on the map is removed (in the latter case x and y will be 0).

It looks like the player ID will still contain the ID of the player who planted the bomb. Even if that player already left / a new player joined and received the same ID.

The same value is also used for the scoring system. Therefore this special edge case can probably even lead to a bug (wrong player getting extra score for bomb planting without planting it at all).

alt Re: How does the bomb explode hook work?

Mami Tomoe
User Off Offline

Zitieren
I see, I think that should be documented on the website.

Also, will that ever change, or should I override the game action with a Lua script of my own?


EDIT:
It appears that you get the score for planting the bomb even if the bomb doesn't end up exploding (returned 1 on the cs2d lua hook bombexplode).
4× editiert, zuletzt 23.05.21 23:24:26

alt Re: How does the bomb explode hook work?

DC
Admin Off Offline

Zitieren
I guess it's a bug that the score is still affected when you return 1 in the hook. Can't tell you if this will be changed/fixed some day. Probably not.

Regarding range:
See cs2d entity info_bombspot - it's in int[0]. You can use cs2d lua cmd entity to get that value.

The explosion damage value is 500 when you're exactly in the center of the explosion. The default range (when a range of 0 is specified) is 400.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht