Jump to content

voice bind


Recommended Posts

Posted

How to change the button(voice)? By standard it's "Z" button. How to change this at the code level, and not in the settings of mta ?

For example, when a player connect to the server and it automatically changes the button to the selected one(in code)

Posted
Just now, HassoN said:

Use 


set

to modify meta.xml settings.

Can you tell me more about it? I do not understand how it can be used in my situation .

Posted

For whatever resource that uses a <settings></settings> in it, you could use the function "set" to modify its value from inside the game. For example if the setting's name is "keyBind" and it's used with the key "X" you could use something like this: set("keyBind", "Z") to change its value. You may check the example of the "set" function in the wiki of MTA as well.

Posted
1 minute ago, HassoN said:

For whatever resource that uses a <settings></settings> in it, you could use the function "set" to modify its value from inside the game. For example if the setting's name is "keyBind" and it's used with the key "X" you could use something like this: set("keyBind", "Z") to change its value. You may check the example of the "set" function in the wiki of MTA as well.

I just have to write it in meta.xml(voice script ) ??
 

<settings>set("keyBind", "X")</settings>

and a button instead "Z" will become "X" or I again misunderstood?

Posted (edited)

No. Basically it should be something like this:

 

-- meta.xml

<settings>
	<setting name="keyBind" value="X" /> 
</settings>
-- Server side

set("keyBind", "Z")

Main value is "X" as you specified in the meta. but in the server side you are changing it to Z.

Edited by HassoN
  • Scripting Moderators
Posted

You can't change the bind.

  • Scripting Moderators
Posted
13 minutes ago, slapz0r said:

Is the person from the top wrong or misunderstood?

Yeah, he probably misunderstood you.

Posted
19 minutes ago, slapz0r said:

Is the person from the top wrong or misunderstood?

I thought you were talking about modifying the value of a setting in meta.xml.
I've checked the voice resource and yea apparently it's not possible to change the key.

Posted
2 minutes ago, HassoN said:

I thought you were talking about modifying the value of a setting in meta.xml.
I've checked the voice resource and yea apparently it's not possible to change the key.

And at the level of the code can not change any binds?

The same, for example, moving forward "W" 

Posted
3 minutes ago, slapz0r said:

And at the level of the code can not change any binds?

The same, for example, moving forward "W" 

You can't force players to change their game's default settings.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...