Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Nades Api


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 476
  • Lokalizacja:AMXX.PL
Offline

Napisano 26.03.2013 07:10

Nades Api



.: 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 :.




Code:
// Flash forwards
forward OnFlashNadenadeBounceTouch(ent, pOther);
forward OnFlashNadeTumbleThink(ent);
forward OnFlashNadeDetonate(ent);
forward OnFlashNadeSmoke(ent);

// HeGrenade forwards
forward OnHeNadenadeBounceTouch(ent, pOther);
forward OnHeNadeTumbleThink(ent);
forward OnHeNadeDetonate(ent);
forward OnHeNadeSmoke(ent);

// SmokeGrenade forwards
forward OnSmokeNadenadeBounceTouch(ent, pOther);
forward OnSmokeNadeTumbleThink(ent);
forward OnSmokeNadeDetonate(ent);
forward OnSmokeNadeSmoke(ent);



.: Natives :.




Code:
// Returns TumbleThink index // FLASH // HE
native Get_Nade_TumbleThink();

// Returns BounceTouch index // FLASH // HE // SMOKE
native Get_Nade_BounceTouch();

// Returns Detonate index // FLASH
native Get_Nade_Detonate();

// Returns Smoke index // FLASH
native Get_Nade_Smoke();

// Returns Detonate3 index // HE
native Get_Nade_Detonate3();

// Returns Smoke3_C index // HE
native Get_Nade_Smoke3_C();

// Returns SG_TumbleThink index // SMOKE
native Get_Nade_SG_TumbleThink();

// Returns SG_Detonate index // SMOKE
native Get_Nade_SG_Detonate();

// Returns SG_Smoke index // SMOKE
native Get_Nade_SG_Smoke();



.: Notes :.


You need those includes in order to compile plugin : https://forums.allie....01#post1712101





Attached Files Dołączona grafika Get Plugin or Get Source (nades_api.sma - 10.1 KB) Dołączona grafika nades_api.inc (1.3 KB)

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych