Raised This Month: $ Target: $400
 0% 

HeNades Effects by SAMURAI Can someone fix this


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pilat100
Member
Join Date: Sep 2009
Old 04-03-2010 , 23:03   HeNades Effects by SAMURAI Can someone fix this
Reply With Quote #1

Can someone fix this ? can someone correct the friendly fire?


PHP Code:
/*
            New HeNades Effects
               Version 0.1 by SAMURAI
    
   * Plugin details:
- The basic sprite from hegrenade explode was replaced with new 13 sprites
New effects, colors, etc
           
   * Required Modules:
- Csx
- Fakemeta

   * Cvars:
- None

   * Admin Commands:
- None


Have a nice day now
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <csx>
 
#define PLUGIN_NAME "New HeNades Effects"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "SAMURAI"
 
// required sprites for plugin
new const g_sprites[][] =
{
    
"sprites/he_efx1.spr",
    
"sprites/he_efx2.spr",
    
"sprites/he_efx3.spr",
    
"sprites/he_efx4.spr",
    
"sprites/he_efx5.spr",
    
"sprites/he_efx6.spr",
    
"sprites/he_efx7.spr",
    
"sprites/he_efx8.spr",
    
"sprites/he_efx9.spr",
    
"sprites/he_efx10.spr",
    
"sprites/he_efx11.spr",
    
"sprites/he_efx12.spr",
    
"sprites/he_efx13.spr"
}


new 
gSpriteIndex[sizeof g_sprites];

 
/******************************************************************
********************** AMXMODX PLUGIN *****************************
******************************************************************/

public plugin_init() 
{
    
// Register the plugin
    
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
    
    
    
// Forward Fakemeta Think
    
register_forward(FM_Think,"fw_think");
 
}


// plugin_precache forward
public plugin_precache()
{
    
    for(new 
0sizeof g_spritesi++)
        
gSpriteIndex[i] = engfunc(EngFunc_PrecacheModel,g_sprites[i]);
        
}
 
/**************************************
grenade_throw CSX Forward           //
It's called when an user throw      //
a grenade                           //
**************************************/
public grenade_throw(id,iGren,wid)
{
    
    
// check if grenade isn't a HeGrenade
    
if(wid != CSW_HEGRENADE)
        return 
PLUGIN_CONTINUE;
    
    
// check if Grenade entity isn't a valid entity
    
if(!pev_valid(iGren))
        return 
PLUGIN_CONTINUE;
    
    
// set a new classname to HeGrenade
    
set_pev(iGren,pev_classname,"fake_hegren");
    
    
// Make it to explode after 1.6 seconds
    
set_task(1.6,"gre_explode",iGren);
    
    return 
PLUGIN_CONTINUE;
    
}

 
/*****************************************
FM Think Fakemeta Forward              //
On this case, help to stop hegrenade   //
from original explosion               //
***************************************/
public fw_think(ent)
{
    if(!
pev_valid(ent))
        return 
FMRES_IGNORED;
        
    if(!
pev(ent,pev_bInDuck))
        return 
FMRES_IGNORED;
    
    new class[
32];
    
pev(ent,pev_classname,class,31);
    
    if(
equali(class,"fake_hegren"))
        return 
FMRES_SUPERCEDE;
        
    
    return 
FMRES_IGNORED;
        
}
 
 
/*****************************************
This is called when hegrenade is       //
explode with new sprites               //
***************************************/ 
public gre_explode(ent)
{
    
// check if entity isn't valid
    
if(!pev_valid(ent))
        return;
        
    
// new variable for origin and get origin of entity
    
static Float:origin[3];
    
pev(ent,pev_origin,origin);
    
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    
write_byte(TE_EXPLOSION); // TE_EXPLOSION
    
write_coord(floatround(origin[0])); // origin x
    
write_coord(floatround(origin[1])); // origin y
    
write_coord(floatround(origin[2])); // origin z
    
write_short(gSpriteIndex[random(sizeof g_sprites)]); // sprites
    
write_byte(40); // scale in 0.1's
    
write_byte(30); // framerate
    
write_byte(TE_EXPLFLAG_NONE); // flags
    
message_end(); // message end

In my maps folder in config for editing my map cvars i have mp_friendlyfire 0 this plugin ignores that. So freindlyfire is on.

same problem happens with this cluster_grenade
http://forums.alliedmods.net/showthread.php?t=8681

Last edited by Pilat100; 04-06-2010 at 14:25.
Pilat100 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 04-03-2010 , 23:04   Re: HeNades Effects by SAMURAI Can someone fix this
Reply With Quote #2

use [ php ] [ /php ]
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Old 04-05-2010, 20:48
Pilat100
This message has been deleted by YamiKaitou. Reason: bump
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode