Raised This Month: $12 Target: $400
 3% 

Block HE nade explosion


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 07-26-2010 , 11:35   Block HE nade explosion
Reply With Quote #1

How I can block the HE nade explosion ? I want just throw it and instead of explode, make it disappear.
__________________
Javivi is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-26-2010 , 12:05   Re: Block HE nade explosion
Reply With Quote #2

Already asked, already answered..
__________________
Arkshine is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 07-26-2010 , 12:12   Re: Block HE nade explosion
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
Already asked, already answered..
Google doesn't find anything
__________________
Javivi is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 07-27-2010 , 02:15   Re: Block HE nade explosion
Reply With Quote #4

PHP Code:
/* ==  ==  ==  ==  ==  ==  ==  ==     Change the font to "Times New Roman" with a size of 10 for a good readability     ==  ==  ==  ==  ==  ==  == */

#define PLUGIN     "Block HE Explosion"
#define AUTHOR     "Leon McVeran"
#define VERSION     "beta"

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

public plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_forward(FM_Think"fwd_think")
}

public 
fwd_think(iEntity){
    if (!
pev_valid(iEntity)){
        return 
FMRES_IGNORED
    
}

    new 
szModel[25]
    
pev(iEntitypev_modelszModel24)
    if (
equali(szModel"models/w_hegrenade.mdl")){
        new 
Float:fDmgTime
        pev
(iEntitypev_dmgtimefDmgTime)

        if (
fDmgTime <= get_gametime() && fDmgTime != 0.0){
            
func_nade_explode(iEntity)
            return 
FMRES_SUPERCEDE
        
}
    }
    return 
FMRES_IGNORED
}

public 
func_nade_explode(iEntity){
    if (!
pev_valid(iEntity)){
        return
    }

    
// Your replacement for the explosion
    // ...

__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 07-28-2010 , 07:56   Re: Block HE nade explosion
Reply With Quote #5

Can't this be done without fw_think? Because this simply eats cpu.
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-28-2010 , 09:42   Re: Block HE nade explosion
Reply With Quote #6

You can always make new entity with granade model while attacking with granade.
Gadzislaw007 is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 07-29-2010 , 02:44   Re: Block HE nade explosion
Reply With Quote #7

Ofcourse, that need a little bit more CPU, but this should not the problem. Trust me!

But you could also use the engine.

PHP Code:
register_forward(FM_Think"fwd_think"

PHP Code:
register_think("grenade","fwd_think"
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 07-30-2010 , 10:23   Re: Block HE nade explosion
Reply With Quote #8

Um, its not working... when i try to throw a nade... SVC_BAD

PHP Code:
public fw_NadeThink(iEntity)
{
    if (!
pev_valid(iEntity))
    {
        return 
FMRES_IGNORED
    
}

    new 
szModel[25]
    
pev(iEntitypev_modelszModel24)

    if (
equali(szModel"models/w_hegrenade.mdl"))
    {
        new 
Float:fDmgTime
        pev
(iEntitypev_dmgtimefDmgTime)

        if (
fDmgTime <= get_gametime() && fDmgTime != 0.0)
        {
            
client_print0print_chat"HI" )
            
//func_nade_explode(iEntity)
            
return FMRES_SUPERCEDE
        
}
    }
    return 
FMRES_IGNORED

__________________
Javivi is offline
master4life
Senior Member
Join Date: Mar 2006
Location: Germany
Old 07-30-2010 , 10:47   Re: Block HE nade explosion
Reply With Quote #9

Try this

PHP Code:
register_forwardFM_SetModel"FwdSetModel");

[...]

public 
FwdSetModel( const iEntity, const szModel[ ] ) {
    if( !
pev_validiEntity ) || !( <= id <= g_iMaxPlayers ) ) 
        return 
FMRES_IGNORED;    
    
    if( 
equalszModel"models/w_hegrenade.mdl" 
    || 
equalszModel"models/w_flashgrenade.mdl" 
    || 
equalszModel"models/w_smokegrenade.mdl" ) )        
            
entity_set_floatiEntityEV_FL_dmgtime9999.0 );

    return 
FMRES_IGNORED;

__________________


[img]http://img714.**************/img714/8612/33726.png[/img]
master4life is offline
Send a message via ICQ to master4life Send a message via MSN to master4life Send a message via Skype™ to master4life
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 07-31-2010 , 02:01   Re: Block HE nade explosion
Reply With Quote #10

Quote:
Originally Posted by Javivi View Post
Um, its not working... when i try to throw a nade... SVC_BAD
Ok, then try using fakemeta instead of engine. I'm using this since 1 1/2 years. Just fine!
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. is offline
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 09:46.


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