Raised This Month: $ Target: $400
 0% 

block +attack, not only on server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 09-02-2004 , 09:41   block +attack, not only on server
Reply With Quote #1

i want to block people from using +attack (they cant fire), it is working (almost), i use this:
Code:
public client_PreThink(id){     if (entity_get_int(id, EV_INT_button) & IN_ATTACK){         entity_set_int(id, EV_INT_button,IN_USE)         return PLUGIN_HANDLED     }                 return PLUGIN_CONTINUE }
this way the player cant fire anymore, BUT he holds the usekey (i could change to IN_CANCEL, would it be better?) and the worser effect is that the client sees that he fires (RAPID fire) but dont loose ammo and he gets bullet decals
when i remove entity_set... does the effect of use go away?
any1 know how to fix it? is there a way to send the player a info that he cant fire, like as he is reloading?
also is it possible to block the sound when fired a weapon or using something?
__________________
alias White Panther
karlos is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-02-2004 , 09:50  
Reply With Quote #2

To block the attack without pressing use, use the method described in http://forums.alliedmods.net/showthread.php?t=5442:
Code:
public client_PreThink(id){     entity_set_int(id, EV_INT_button, entity_get_int(id, EV_INT_button)  & ~IN_ATTACK);     return PLUGIN_CONTINUE }
He will always see the fire animation because it is initiated client-side. Bulet decals are client-side too. The sound must be handled client-side too, otherwise you wouldn't hear it...
__________________
hello, i am pm
PM is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 09-02-2004 , 14:01  
Reply With Quote #3

I think there is a way to stop the animation. What you should do is hook +attack1. Then when he goes to use it block it and set the weapon animation to its idle sequence. For instance I believe the sequence for M4A1 is 7, you should use then entinfo plugin to get which animation is the idle animation.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 09-02-2004 , 14:04  
Reply With Quote #4

thx pm
one more thing is it possible to unarm a player, if u remove/switch guns player still has knife, but i want so it switches him so have no weapon (eg ns in the readyroom), i think that should be possible, or not? this way there would be no decals no sound no animation cause he has no weapon.
__________________
alias White Panther
karlos is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 09-03-2004 , 20:38  
Reply With Quote #5

vortox u meant +attack1 or +attack? if +attack, u cant hook it

does notbody know how do disarm a player?
__________________
alias White Panther
karlos is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 09-03-2004 , 22:10  
Reply With Quote #6

Quote:
vortox u meant +attack1 or +attack? if +attack, u cant hook it
Well yeah that's true. But you can still find out if they are using +attack with something...I can't think of right now...


Anyways. Whatever button your trying to block, you can still stop the animation with

Code:
EV_INT_weaponanim or EV_INT_sequence

Just set them to whatever sequence is "idle" for whatever your trying to stop the animation of.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-04-2004 , 04:12  
Reply With Quote #7

He will still see the fire sequence for a couple of miliseconds (ping)..
Disarming player: I don't know, but I assume there will be a plugin that does it (and somehow I think CSDM does something like that too but maybe I'm wrong)
__________________
hello, i am pm
PM is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 09-04-2004 , 06:49  
Reply With Quote #8

Correct me if I'm wrong but isn't this what your looking for? http://www.amxmodx.org/funcwiki.php?go=func&id=577
twistedeuphoria is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 09-04-2004 , 08:25  
Reply With Quote #9

hell yes, thx twistedeuphoria, thats exactly what i need
__________________
alias White Panther
karlos 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 17:28.


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