AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Do not throw grenade (https://forums.alliedmods.net/showthread.php?t=107060)

alan_el_more 10-22-2009 08:12

Do not throw grenade
 
What is the best way for a player not throw a grenade (SmokeGrenade)?

ot_207 10-22-2009 08:13

Re: Do not throw grenade
 
Ham_Weapon_PrimaryAttack
with offset scripting.

minimiller 10-22-2009 10:59

Re: Do not throw grenade
 
Code:

RegisterHam(Ham_Item_Deploy, "weapon_knife", "FwdDeploySmokeNade", 1);
?

SnoW 10-22-2009 11:05

Re: Do not throw grenade
 
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...

Arkshine 10-22-2009 11:20

Re: Do not throw grenade
 
Quote:

Originally Posted by alan_el_more (Post 969114)
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 ?

Jon 10-22-2009 11:28

Re: Do not throw grenade
 
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?

Arkshine 10-22-2009 11:43

Re: Do not throw grenade
 
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.

joropito 10-22-2009 15:44

Re: Do not throw grenade
 
Quote:

Originally Posted by Arkshine (Post 969219)
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.

haha

you're in love with Orpheu :P

I like Jon's example.

ConnorMcLeod 10-22-2009 15:47

Re: Do not throw grenade
 
Jon, would be better to register the forward POST.

Arkshine 10-22-2009 16:55

Re: Do not throw grenade
 
Indeed, if I remember as pre offset won't be applied.

Quote:

you're in love with Orpheu
Not sure why you say that.


All times are GMT -4. The time now is 17:44.

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