Raised This Month: $ Target: $400
 0% 

How to block grenade throw


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-25-2013 , 14:49   Re: How to block grenade throw
Reply With Quote #1

1. In PrimaryAttack callback, don't change pdata next primaryattack value, just supercede
2. update amxx to 1.8.2
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 04-25-2013 , 14:52   Re: How to block grenade throw
Reply With Quote #2

Thank You very much =)
FromTheFuture is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-25-2013 , 15:16   Re: How to block grenade throw
Reply With Quote #3

Oh and remove all deploy code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 04-25-2013 , 15:35   Re: How to block grenade throw
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Oh and remove all deploy code.
Of course.
Now code looks like:
PHP Code:
#include <amxmodx>
#include <csx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "HeBlock"
#define VERSION "2.1"
#define AUTHOR "FromTheFuture"


const XO_CBASEPLAYERITEM 4;
const 
m_pPlayer 41;

const 
XO_CBASEPLAYERWEAPON 4;
const 
m_flNextPrimaryAttack 46;

new 
Floatg_fNextThrowTime[33];
new 
g_CvarTime;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
g_CvarTime register_cvar("amx_he_blocktime""15.0");
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_hegrenade""OnCHEGrenade_PrimaryAttack"false );
}

public 
OnCHEGrenade_PrimaryAttackpEntity )
{
    new 
id get_pdata_cbasepEntity m_pPlayer XO_CBASEPLAYERITEM );
    new 
Float:flWaitTime g_fNextThrowTime[id] - get_gametime();

    if( 
flWaitTime 0.0 )
    {
        
client_print(idprint_center"Please, wait %d seconds"floatround(flWaitTime));
        return 
HAM_SUPERCEDE;
    }
    return 
HAM_IGNORED;
}

public 
grenade_throw(idgidwid)
{
    if(
wid == CSW_HEGRENADE)
    {
        
g_fNextThrowTime[id] = get_gametime() + get_pcvar_float(g_CvarTime);
    }

FromTheFuture is offline
Hamartia
Member
Join Date: Oct 2015
Old 12-08-2015 , 13:50   Re: How to block grenade throw
Reply With Quote #5

I find this plugin useful. Was searching for this at all the sub forums. When a perfect plugin is finally out of a post in scripting/request section, can't we post in the new plugin forum with credits to author ?
Hamartia is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 12-08-2015 , 22:29   Re: How to block grenade throw
Reply With Quote #6

Quote:
Originally Posted by Hamartia View Post
I find this plugin useful. Was searching for this at all the sub forums. When a perfect plugin is finally out of a post in scripting/request section, can't we post in the new plugin forum with credits to author ?
Enjoy!
FromTheFuture 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 10:46.


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