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

Block shooting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 03-20-2011 , 03:15   Block shooting
Reply With Quote #1

This may be impossible because of client prediction, but is it possible to block a player from shooting without freezing them with the FL_FROZEN flag?

I need to block a player's ability to shoot for a certain amount of time.

Don't refer me to TraceAttack to prevent the damage. That's only if all else fails.
__________________
Greyscale is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 03-20-2011 , 04:16   Re: Block shooting
Reply With Quote #2

Removing Ammo and giving back after a few seconds?
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
Dravu
Senior Member
Join Date: May 2010
Old 03-20-2011 , 04:35   Re: Block shooting
Reply With Quote #3

What game is this for?
Dravu is offline
SideX
Senior Member
Join Date: Jun 2010
Location: Ukraine, Melitopol.
Old 03-20-2011 , 05:05   Re: Block shooting
Reply With Quote #4

Maybe:
PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
buttons IN_ATTACK && time[client])
        
buttons &= ~IN_ATTACK;
    return 
Plugin_Continue;

Where time[client] - bool variable which need to be true for blocking attack to client.
SideX is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 03-20-2011 , 05:50   Re: Block shooting
Reply With Quote #5

CS:S is the game.

I forgot about OnPlayerRunCmd. I think that'll work. Although I'm 95% sure client predictions are going to make it appear as if they are shooting.
__________________
Greyscale is offline
Dravu
Senior Member
Join Date: May 2010
Old 03-20-2011 , 06:18   Re: Block shooting
Reply With Quote #6

No experience with CS:S unfortunately, but if the weapons have an offset for m_flNextPrimaryAttack, then I'm assuming you could set it to a ridiculous number to prevent them from being able to shoot.
Dravu is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 03-20-2011 , 08:02   Re: Block shooting
Reply With Quote #7

do what Dravu said, i do that in weaponmod to block burst on the glock and silencer on the usp, it avoids the nasty prediction related animation glitches. be warned that it will reset after certain events like weapon switching, reloading etc if the weapon has an alt mode then you'll need to block that aswell as its linked to the shooting.
blodia is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 03-20-2011 , 14:36   Re: Block shooting
Reply With Quote #8

How do I block the alt mode? Like right-click knifing for example.

EDIT:

I'm guessing you mean set this as well: m_flNextSecondaryAttack That'll block secondary knifing hopefully.
Btw it's working great thank you Dravu/blodia!
__________________

Last edited by Greyscale; 03-20-2011 at 14:45.
Greyscale 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 05:36.


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