Ejemplo n.º 1
0
        /// <summary>
        /// Enables a control during the next frame.
        /// </summary>
        /// <param name="control">The control to enable.</param>
        public static void EnableThisFrame(Control control)
        {
#if FIVEM
            API.EnableControlAction(0, (int)control, true);
#elif RPH
            NativeFunction.CallByHash <int>(0x351220255D64C155, 0, (int)control);
#elif (SHVDN2 || SHVDN3)
            Function.Call(Hash.ENABLE_CONTROL_ACTION, 0, (int)control);
#endif
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Checks if a control was pressed during the last frame.
        /// </summary>
        /// <param name="control">The control to check.</param>
        /// <returns>true if the control was pressed, false otherwise.</returns>
        public static bool IsJustPressed(Control control)
        {
#if FIVEM
            return(API.IsDisabledControlJustPressed(0, (int)control));
#elif RPH
            return(NativeFunction.CallByHash <bool>(0x91AEF906BCA88877, 0, (int)control));
#elif (SHVDN2 || SHVDN3)
            return(Function.Call <bool>(Hash.IS_DISABLED_CONTROL_JUST_PRESSED, 0, (int)control));
#endif
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Checks if a control is currently pressed.
        /// </summary>
        /// <param name="control">The control to check.</param>
        /// <returns>true if the control is pressed, false otherwise.</returns>
        public static bool IsPressed(Control control)
        {
#if FIVEM
            return(API.IsDisabledControlPressed(0, (int)control));
#elif RPH
            return(NativeFunction.CallByHash <bool>(0xE2587F8CBBD87B1D, 0, (int)control));
#elif (SHVDN2 || SHVDN3)
            return(Function.Call <bool>(Hash.IS_DISABLED_CONTROL_PRESSED, 0, (int)control));
#endif
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Disables a control during the next frame.
        /// </summary>
        /// <param name="control">The control to disable.</param>
        public static void DisableThisFrame(Control control)
        {
#if FIVEM
            API.DisableControlAction(0, (int)control, true);
#elif RPH
            NativeFunction.CallByHash <int>(0xFE99B66D079CF6BC, 0, (int)control, true);
#elif (SHVDN2 || SHVDN3)
            Function.Call(Hash.DISABLE_CONTROL_ACTION, 0, (int)control, true);
#endif
        }