Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Sign in to follow this  
_PIONER

Как сделать bind

Всем привет, подскажите пожалуйста.
В настройках игры, есть параметр включение и отключение чата.
Как этот параметр вывести на кнопку, что бы в игре по нажатию клавиши, можно было отключить его или включить не заходя в настройки игры.

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Могу подсказать по биндингу кнопки, но что в твоей функции нужно сделать - не знаю.
тебе понадобится в моде создать файл имямода/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

 

Share this post


Link to post
Share on other sites



  • 0
26.12.2023 в 13:35, Archon7th сказал:

Могу подсказать по биндингу кнопки

Привет, отличный мануал, спасибо.)
А вообще, всё это в общем и целом, для мода SchanaModGlobalChat.
Была задумка отклшючение и включение чата нажатием клавиши, так как многим не нравится писанина в чате. А порой и мешает.
Можно конечно отключить в меню, но каждому не объяснить конечно и вроде как бы сделать кнопку, по нажатию которой, в меню игры отключался или включался параметр "чата", но и туттупик.
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.