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

+Use for TF2, hooked to secondary fire?


Post New Thread Reply   
 
Thread Tools Display Modes
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-17-2015 , 10:03   Re: +Use for TF2, hooked to secondary fire?
Reply With Quote #11

Eww, don't server command cvars.

You can do this with runcmd forward by changing the buttons, or in some other fast repeating cmds by manually setting the client buttons netprop really fast. It is best to use the forward, its made for this.

Alternatively you can edit all of the button entities to respond to damage, hook them for ontakedamage, and block damage.. Then do something like medic key will deal 1 damage to those buttons when pressed to activate them.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
cam0
Senior Member
Join Date: Feb 2015
Old 12-17-2015 , 15:24   Re: +Use for TF2, hooked to secondary fire?
Reply With Quote #12

I think you should be using
Code:
buttons |= IN_USE;
__________________
cam0 is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-18-2015 , 08:58   Re: +Use for TF2, hooked to secondary fire?
Reply With Quote #13

^ Yea what he said.

(1100 += 1010) == 10110 == 22
(1100 |= 1010) == 1111 == 15

|= is the one you want
__________________

Last edited by Chdata; 12-18-2015 at 08:58.
Chdata is offline
cheddar
Member
Join Date: Sep 2015
Old 01-05-2016 , 04:07   Re: +Use for TF2, hooked to secondary fire?
Reply With Quote #14

Thanks everyone for your suggestions. Thanks cam0 and Chdata for the correction on my binary arithmetic/logic.

Quote:
Originally Posted by friagram View Post
Eww, don't server command cvars.

You can do this with runcmd forward by changing the buttons, or in some other fast repeating cmds by manually setting the client buttons netprop really fast. It is best to use the forward, its made for this.

Alternatively you can edit all of the button entities to respond to damage, hook them for ontakedamage, and block damage.. Then do something like medic key will deal 1 damage to those buttons when pressed to activate them.
Friagram, I just realized there's a way to do what you mentioned. There's ZERO reason for this plugin when we have stripper source. I can simply make a match filter that changes all buttons from "on +use" to "on take damage"... Then clients can just shoot doors and they'll open... I'll be testing this method and post my results...

In case anyone doesn't know what I mean by stripper:
https://forums.alliedmods.net/showthread.php?t=39439

Last edited by cheddar; 01-05-2016 at 04:18.
cheddar is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-05-2016 , 14:43   Re: +Use for TF2, hooked to secondary fire?
Reply With Quote #15

Quote:
Originally Posted by friagram View Post
Then do something like medic key will deal 1 damage to those buttons when pressed to activate them.
Also might as well just fire the "Use" with the activator being the client on to the button, instead of damage.

AcceptEntityInput(button, "Use", client, client, 0)

Last edited by Mitchell; 01-05-2016 at 14:45.
Mitchell is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-05-2016 , 22:12   Re: +Use for TF2, hooked to secondary fire?
Reply With Quote #16

Quote:
Originally Posted by Mitchell View Post
Also might as well just fire the "Use" with the activator being the client on to the button, instead of damage.

AcceptEntityInput(button, "Use", client, client, 0)
That works too if use is allowed on it
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 08:15.


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