Thread: Nades Api
View Single Post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-26-2013 , 02:11   Re: Nades Api
Reply With Quote #2

Example on how to make a flashbang grenade explode as a smokegrenade instead of blinding players :

Code:
#include <amxmodx> #include <nades_api> #tryinclude <cstrike_pdatas> #if !defined _cbaseentity_included         #assert Cstrike Pdatas and Offsets library required! Read the below instructions:   \                 1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101   \                 2. Put it into amxmodx/scripting/include/ folder   \                 3. Compile this plugin locally, details: wiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29   \                 4. Install compiled plugin, details: wiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing #endif #define PLUGIN "" #define VERSION "0.0.1" #define SetThink(%0,%1) set_pdata_int(%0, m_pfnThink, %1, 0) new SG_Detonate new g_iEvent_CreateSmoke public plugin_init() {     register_plugin( PLUGIN, VERSION, "ConnorMcLeod" )     g_iEvent_CreateSmoke = engfunc(EngFunc_PrecacheEvent, 1, "events/createsmoke.sc")     set_task(2.0, "Retrieve_Functions") } public Retrieve_Functions() {     SG_Detonate = Get_Nade_SG_Detonate() } public OnFlashNadeDetonate( ent ) {     if( pev(ent, pev_flags) & FL_ONGROUND )     {         SetThink(ent, SG_Detonate)         set_pdata_short(ent, m_usEvent_Grenade, g_iEvent_CreateSmoke)     }     set_pev(ent, pev_nextthink, get_gametime() + 0.1)     return PLUGIN_HANDLED }
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-26-2013 at 02:15.
ConnorMcLeod is offline