How to detect if a button is in range
How do I know if a player can press a button (he is close enough) to use it?
|
Re: How to detect if a button is in range
Loop all "func_button" entities in a X radius around the player using the "find_sphere_class" function.
You can find the X by doing a simple test - adding a chat message when you press a button that prints out the distance between the player and the button entity. Or I guess you can look in the game's code to find the 100% accurate distance. //Edit: I believe the radius is 64 according to this: Code:
|
| All times are GMT -4. The time now is 17:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.