Find if a user has pressed a button?
I was wondering how I would go about making it so if a user on my server hits a button they get slayed, at the same time not making the button work?
The Entid for the button is "661" Its target is "diner_robber" This button is used to crash the server so yea... Edit: I know how to remove it, I just think it would be funny if they were slayed with a message on everyones screen saying (%s HAS BEEN SLAIN FOR USING THE SERVER CRASH BUTTON!" |
Re: Find if a user has pressed a button?
I assume when you mean "Is target is "diner_robber". I'm assuming that the pev_target of the entity. I only coded this I havn't test it any further than that. Also if there is more than one entity with that label as target it will probably screw it up.
Code:
|
Re: Find if a user has pressed a button?
blackops7799: You can't hook when an entity is used.
teame06: That will only work if the user's crosshair is placed directly over the button when pressing it. EDIT: This is now possible through sawce's Ham Sandwich module. |
Re: Find if a user has pressed a button?
Oh yea, I forgot you can still press the button while not aiming at it.
|
Re: Find if a user has pressed a button?
Well, can I remove the button, and if they are in the area of where the button was and press E they will be killed.
|
Re: Find if a user has pressed a button?
Ham Sandwich module by sawce can hook and block the actual use (not the command but so called "event").
|
| All times are GMT -4. The time now is 00:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.