.: Description :.
Little Api that let's you know by forwards when a grenade is bouncing or is exploding, is smoking after the explosion, or is simply thinking because it's not time to to something else yet.
This plugin also exposes some natives to retrieve those functions indexes (internally it is pointers but we can use them as integers) that are used with pdata m_pThink and m_pUse.
.: How does the game works :.
When a grenade is shot, its m_pfnTouch function is set to BounceTouch, this function is called internally each time a nade is touching the world (sound is only played on 5 first times).
At grenade shot, m_pfnThink is set to TumbleThink for flash and hegrenade, and to SG_TumbleThink for smokegrenade, this is default think and ends when pev->dmgtime <= gpGlobals->time (and for smoke if nade is on the ground)
Then, m_pfnThink is change to Detonate, Detonate3 and SG_Detonate for respectlively flashbangs, hegrenades and smokegrenades, this is during those functions that specific grenade actions are done (flash, explosion and smoke).
After those actions it is not complitely finished, m_pfnThink is change to Smoke, Smoke3_C and SG_Smoke (same nades types order), this is function where you gonnna see little black smoke before a nade is about to die.
.: Forwards :.
// Flash forwards
forward OnFlashNadenadeBounceTouch(ent, pOther);
// HeGrenade forwards
forward OnHeNadenadeBounceTouch(ent, pOther);
// SmokeGrenade forwards
forward OnSmokeNadenadeBounceTouch(ent, pOther);
.: Natives :.
// Returns TumbleThink index // FLASH // HE
// Returns BounceTouch index // FLASH // HE // SMOKE
// Returns Detonate index // FLASH
// Returns Smoke index // FLASH
// Returns Detonate3 index // HE
// Returns Smoke3_C index // HE
// Returns SG_TumbleThink index // SMOKE
// Returns SG_Detonate index // SMOKE
// Returns SG_Smoke index // SMOKE
.: Notes :.
You need those includes in order to compile plugin : https://forums.allie....01#post1712101
Attached Files Get Plugin or Get Source (nades_api.sma - 10.1 KB) nades_api.inc (1.3 KB)
Wyświetl pełny artykuł