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

Do not throw grenade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-22-2009 , 08:12   Do not throw grenade
Reply With Quote #1

What is the best way for a player not throw a grenade (SmokeGrenade)?
__________________
alan_el_more is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-22-2009 , 08:13   Re: Do not throw grenade
Reply With Quote #2

Ham_Weapon_PrimaryAttack
with offset scripting.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Old 10-22-2009, 10:56
lazarev
This message has been deleted by lazarev. Reason: blablabla
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-22-2009 , 10:59   Re: Do not throw grenade
Reply With Quote #3

Code:
RegisterHam(Ham_Item_Deploy, "weapon_knife", "FwdDeploySmokeNade", 1);
?
__________________
minimiller is offline
Send a message via MSN to minimiller
Old 10-22-2009, 11:03
SnoW
This message has been deleted by SnoW. Reason: You know...
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-22-2009 , 11:05   Re: Do not throw grenade
Reply With Quote #4

You register it for knives( where's smokes? ), the cvar fails big time, you never use client variable and you should return in the func. Also player can actually throw a smoke, the forward is post, so...
SnoW is offline
Send a message via MSN to SnoW
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-22-2009 , 11:20   Re: Do not throw grenade
Reply With Quote #5

Quote:
Originally Posted by alan_el_more View Post
What is the best way for a player not throw a grenade (SmokeGrenade)?
You mean having in the hand and not able to throw it or not able the select thsi grenade ?
__________________
Arkshine is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 10-22-2009 , 11:28   Re: Do not throw grenade
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

const m_flNextPrimaryAttack 46;

public 
plugin_init( )
{
    
RegisterHamHam_Item_Deploy"weapon_smokegrenade""FwdDeploySmoke" );
}

public 
FwdDeploySmokeiEnt )
{
    
set_pdata_floatiEntm_flNextPrimaryAttack9999.0);

Maybe someone could do an example with orpheu?
Jon is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-22-2009 , 11:43   Re: Do not throw grenade
Reply With Quote #7

In this situation, there is not a better way. Using Orpheu you can hook CSmokeGrenade::Deploy() but you still would need to use the offset to block properly.
__________________
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 10-22-2009 , 15:44   Re: Do not throw grenade
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
In this situation, there is not a better way. Using Orpheu you can hook CSmokeGrenade:eploy() but you still would need to use the offset to block properly.
haha

you're in love with Orpheu

I like Jon's example.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-22-2009 , 15:47   Re: Do not throw grenade
Reply With Quote #9

Jon, would be better to register the forward POST.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-22-2009 , 16:55   Re: Do not throw grenade
Reply With Quote #10

Indeed, if I remember as pre offset won't be applied.

Quote:
you're in love with Orpheu
Not sure why you say that.
__________________
Arkshine is offline
Old 10-22-2009, 17:02
ConnorMcLeod
This message has been deleted by ConnorMcLeod. Reason: wanted to read the post !!
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 05:29.


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