Перейти к содержанию

Controls::isInputDisabled

Материал из RAGE MP Wiki Archive
Версия от 10:56, 14 мая 2024; imported>Shr0x (See also)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Seems to return true if the input is currently disabled. '_GET_LAST_INPUT_METHOD' didn't seem very accurate, but I've left the original description below.

--

index usually 2

returns true if the last input method was made with mouse + keyboard, false if it was made with a gamepad

0, 1 and 2 used in the scripts. 0 is by far the most common of them.

Syntax

<syntaxhighlight lang="javascript">mp.game.controls.isInputDisabled(inputGroup);</syntaxhighlight>

Required Arguments

  • inputGroup: int

Return value

  • Boolean

Example

<syntaxhighlight lang="javascript"> // test if the player is using a controller vs keyboard/mouse

function isUsingController(){

   return !mp.game.controls.isInputDisabled(0);

} </syntaxhighlight>

See also