S&box Wiki

Revision Difference

DoPlayerDevCam#546107

<cat>Code.Player</cat> <title>DoPlayerDevCam</title> # What is a DoPlayerDevCam ? ⤶ It is a function which allows to block devcam to all the players. ⤶ # Example⤶ # What is a DoPlayerDevCam? ⤶ DoPlayerDevCam is a method which allows you to block or modify a player's attempts to use a developer camera. ```csharp public override void DoPlayerDevCam( Client player ) { base.DoPlayerDevCam( player ); } ``` ⤶ # How to add an exception ?⤶ ⤶ So you are the creator of the gamemode, and for debugging or any reasons, you need to access the DevCam.⤶ ⤶ - `SteamId` - This is called steamID64 (Decimal), you can find your steam id here : [SteamIdFinder](https://www.steamidfinder.com/)⤶ # Example⤶ If you want to limit access to the developer camera, you can refuse to call `base.DoPlayerDevCam()` In this example, we use a player's Steam64ID (you can find yours [with this site](https://www.steamidfinder.com/)) to grant access to the developer camera.⤶ ```csharp public override void DoPlayerDevCam( Client player ) { if ( player.SteamId != YourSteamIdHereIn64Dec) return; base.DoPlayerDevCam( player ); } ``` ⤶ How you decide a player may be granted access to the developer camera is up to you. You may wish to set a password, or limit by Steam IDs (seen above). You may also wish to create a new developer camera from scratch!