actions_on_button_press 1.0.1

This commit is contained in:
Resxt 2022-02-25 22:51:40 +01:00 committed by GitHub
parent 2b84548292
commit 9cc07ff9a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,13 +2,12 @@
This script shows how you can execute functions and change dvars for a player when that player presses a certain button while showing him instructions on his screen using the key defined in his game.
If you use `+melee` and the player's melee key is set to V it'll show V on his screen, if he uses another key it'll show his key.
* The first button lets the player toggle the `camera_thirdPerson` dvar (used to play in third person while keeping the crosshair on and is also better/more configurable than `cg_thirdPerson` in my opinion)
Note that `camera_thirdPerson` is a special case and needs to be changed with `SetDynamicDvar()` but in most cases like with `cg_thirdPerson` you'd use `SetDvar()` instead.
* The second button lets the player suicide using the `Suicide()` function.
If you use `+melee` and the player's melee key is set to V it'll show V on his screen, if he uses another key it'll show his key.
If you want to use another button simply change `level.third_person_button` and/or `level.suicide_button` values and it will update the button pressed to start the function and the text displayed on the player's screen.
I used actionslot 6 and 7 because (to my knowledge) they are not used by anything else in the game
@ -31,4 +30,4 @@ Here is a non-exhaustive list of buttons you can use
"+speed_throw"
"+stance"
"+breathe_sprint"
```
```