AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block +attack, not only on server (https://forums.alliedmods.net/showthread.php?t=5455)

karlos 09-02-2004 09:41

block +attack, not only on server
 
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?

PM 09-02-2004 09:50

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...

Votorx 09-02-2004 14:01

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.

karlos 09-02-2004 14:04

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.

karlos 09-03-2004 20:38

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

does notbody know how do disarm a player?

Votorx 09-03-2004 22:10

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.

PM 09-04-2004 04:12

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)

twistedeuphoria 09-04-2004 06:49

Correct me if I'm wrong but isn't this what your looking for? :arrow: http://www.amxmodx.org/funcwiki.php?go=func&id=577

karlos 09-04-2004 08:25

hell yes, thx twistedeuphoria, thats exactly what i need


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

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