Player Buttons
Player Buttons
I see you have exported player buttons constants here. How would I use those? Am I able to check if a player is holding down a button?
I played this quite a bit the other day, to make a double jump feature in CSGO. It always displays an integer indicating to which button/s are being held at that point. If you check a player's pressed buttons upon the "player_jump" event, you should get the integer 2. Unless you are holding another key as well.
I found the function again.
Syntax: Select all
## Will display the current action being performed by the user. "+jump" is a value of 2. If no buttons are pressed an output of 0 is given.
<PlayerEntity>.get_last_user_command()
I don't remember us having wrapped that, but maybe we have. It's probably a PlayerInfo member function I don't remember. For now, until we add the buttons alias, simply use:
Syntax: Select all
if <PlayerEntity>.get_property_int('m_nButtons') & PlayerButtons.JUMP:
print('player attempting to jump')
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Correct, this is part of PlayerInfo, more info here.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 127 guests