Могу подсказать по биндингу кнопки, но что в твоей функции нужно сделать - не знаю.
тебе понадобится в моде создать файл имямода/Scripts/Data/inputs.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<modded_inputs>
<!-- declarations -->
<inputs>
<actions>
<input name="MyCustomKey" loc="My Custom Key" />
</actions>
</inputs>
<!-- preset -->
<preset>
<input name="MyCustomKey">
<btn name="kI" />
</input>
</preset>
</modded_inputs>
<btn name="kI" /> - это клавиша "i" по дефолту
в config.cpp в CfgMods класс мода прописать
inputs = "имямода\Scripts\Data\Inputs.xml";
там же понадобится
class defs
{
class missionScriptModule
{
value = "";
files[] = {"имямода/Scripts/5_Mission"};
};
};
далее понадобится его обработать
создаешь в имямода/Scripts/5_Mission/missionGameplay.c
modded class MissionGameplay
{
override void OnUpdate(float timeslice)
{
super.OnUpdate(timeslice);
UAInput MyCustomKey = GetUApi().GetInputByName("UAMyCustomKey");
if(MyCustomKey.LocalClick())
{
PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
Print("MyCustomKey is pressed by player "+player);
}
}
};
учти что обработка происходит на клиенте, если что-то нужно сделать на сервере то понадобится RPC