Smoke events?
How can I capture the coordination of exploded smoke grenade?
I try to do code which will be infect players who went into smoke. Are there any events or something which could help me to do that? |
Re: Smoke events?
You can try something like :
Code:
and in your code : Code:
Just an example. Note : grenade is the "grenade" entity index. |
Re: Smoke events?
Quote:
|
Re: Smoke events?
I've already fixed before you post ;) but yes, it was obviously a typo.
|
Re: Smoke events?
ok but when I must called this function. how can I capture message when somebody threw smoke grenade?
|
Re: Smoke events?
|
Re: Smoke events?
thank You very much :)
|
Re: Smoke events?
You can use grenade_throw forward to hook when a grenade is thrown.
This forward is based on SetModel forward, in others words grenade_throw is called right after a throw(ing?) when the grenade model is applied. The problem is : the explosion comes after, so you may think that's not a good way. Here, a preview of a basic flow (and only what we need) of a smoke grenade explosion : Code:
You throw a grenadeBut since the player's id is not passed for this event, we need some trick. An example : PHP Code:
Note #1 : It's an example, so it may need more check for example if player is still connected, or if you throw a grenade, the game is reset or new round and the grenade is removed right away without exploding, the Array would need to be destroy. Such situation where you need to check. Note #2 : A more direct way would be simply to hook directly CGrenade::SG_Detonate() as post, with orpheu and retrieving the m_SGExplosionPos offset. If you don't care using Orpheu module, tell me. |
Re: Smoke events?
biig thanks again :)
|
| All times are GMT -4. The time now is 00:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.