[help] controls

need some help with inputs/controls. I know the key tables are wrong so i don’t use them. I’m having problems with buttons on the controller opening menus when they should not. For example I set a menu to if IsControlPressed(0, 311) then. Which is K on the keyboard and links to no other control keyboard or controller. Yet down on the D pad opens the menu. I tried if IsControlJustReleased(0, 311) then, and the issue remains. I am trying to make my server both keyboard and controller friendly but right now with a controller you cant run because X opens a menu, cant get into cars because Triangle opens the phone and square opens the animations. Yes its [esx] and i have yet to add resouces that add even more menus. So i would like to figure out the problem. thanks.

Add this after the control function

GetLastInputMethod( 0 )

For Example (taken from WK’s Radar Script)

if ( IsDisabledControlPressed( 1, 70 ) and IsDisabledControlJustPressed( 1, 213 ) and GetLastInputMethod( 0 ) ) then

Don’t take my word for it but “0” in GetLastInputMethod( 0 ) is definitely keyboard only, and “1” may possibly be controller input only…

appreciate that, I will definitely look into that. But for now i went with something like if IsControlJustReleased(0, 289) and IsControlPressed(0, 131). seems that the left shift corresponds to square on the controller. so for keyboard hold L shift and hit the next key, and on controller hold square and hit next button.

if IsControlPressed(0, 289) and GetLastInputMethod(2) then

seems to work just fine. just updated esx base and thats whats being used there.

1 Like

where would I go to find it