Log in to reply
 

Activating a Mod via Gamepad instead of hotkey



  • How would one code a hotkey to work with a gamepad? Can it be done with scripthook? Thanks in advance to those that can answer. Also, what's a good resource to learn mod coding so I don't have to bombard you guys with questions? Unless.....ya'll like it???



  • Use the _IS_INPUT_DISABLED native to check if the gamepad is being used or not and use IS_DISABLED_CONTROL_JUST_PRESSED, IS_DISABLED_CONTROL_JUST_RELEASED, or IS_DISABLED_CONTROL_PRESSED (depends on the situation).

    Script Hook V .NET example:

    if (!Function.Call(Hash._GET_LAST_INPUT_METHOD, 2)) //gamepad is being used (_GET_LAST_INPUT_METHOD = _IS_INPUT_DISABLED)
    {
    	if (Game.IsControlJustPressed(2, Control.Attack)) //IS_DISABLED_CONTROL_JUST_PRESSED (list of controls https://github.com/crosire/scripthookvdotnet/blob/dev_v2/source/scripting/Controls.hpp)
    	{
    		//do stuff
    	}
    }
    

    The first things you would need to do are pick a language to learn and learn it by watching videos, reading tutorials, reading source code, and/or reading a book on it. After that (or if you've already done that) really all you can do is Google it, read the NativeDB, and find any documentation you can.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.