Raised This Month: $51 Target: $400
 12% 

Can we use IN_* keys in menus?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 09-17-2022 , 11:28   Can we use IN_* keys in menus?
Reply With Quote #1

Can we use IN_* keys in menus?
Example: I have some item on slot 1 and it will do something if I press slot1. Can I do check if player holds IN_RUN (on another key) pressed and slot1 to do another action?
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 09-17-2022 at 13:38.
kww is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-17-2022 , 11:47   Re: Can we use IN_* keys in menus?
Reply With Quote #2

store it in a global variable?
jimaway is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 09-17-2022 , 13:36   Re: Can we use IN_* keys in menus?
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
store it in a global variable?
what do you mean?
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
zXCaptainXz
Member
Join Date: May 2017
Old 09-17-2022 , 14:26   Re: Can we use IN_* keys in menus?
Reply With Quote #4

(get_user_button(id)&IN_RUN) (or IN_SPEED was it?) will be true if the player is holding shift, so add that check in your handler function

something like this

public menu_handler(id, key)
{
if(get_user_button(id)&IN_RUN))//shift held
{
switch(key){
case 1://if 1 + SHIFT pressed
case 2://if 2 + SHIFT pressed
//...
}
}
else
{
switch(key){
case 1: // if 1 only pressed
case 2: // if 2 only pressed
}
}
zXCaptainXz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode