Jump to content

voice bind


Recommended Posts

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)

Link to comment

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.

Link to comment
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?

Link to comment

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
Link to comment
  • Scripting Moderators
13 minutes ago, slapz0r said:

Is the person from the top wrong or misunderstood?

Yeah, he probably misunderstood you.

Link to comment
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.

Link to comment
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" 

Link to comment

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...