fairyoggy Posted July 8, 2019 Share Posted July 8, 2019 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
HassoN Posted July 8, 2019 Share Posted July 8, 2019 Use set to modify meta.xml settings. Link to comment
fairyoggy Posted July 8, 2019 Author Share Posted July 8, 2019 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 . Link to comment
HassoN Posted July 8, 2019 Share Posted July 8, 2019 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
fairyoggy Posted July 8, 2019 Author Share Posted July 8, 2019 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
HassoN Posted July 8, 2019 Share Posted July 8, 2019 (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 July 8, 2019 by HassoN Link to comment
Scripting Moderators Sarrum Posted July 8, 2019 Scripting Moderators Share Posted July 8, 2019 You can't change the bind. Link to comment
fairyoggy Posted July 8, 2019 Author Share Posted July 8, 2019 11 minutes ago, Sarrum said: You can't change the bind. Is the person from the top wrong or misunderstood? Link to comment
Scripting Moderators Sarrum Posted July 8, 2019 Scripting Moderators Share Posted July 8, 2019 13 minutes ago, slapz0r said: Is the person from the top wrong or misunderstood? Yeah, he probably misunderstood you. Link to comment
fairyoggy Posted July 8, 2019 Author Share Posted July 8, 2019 3 minutes ago, Sarrum said: Yeah, he probably misunderstood you. so ... code level can not change the bind for voice chat? Link to comment
HassoN Posted July 8, 2019 Share Posted July 8, 2019 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
fairyoggy Posted July 8, 2019 Author Share Posted July 8, 2019 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
HassoN Posted July 8, 2019 Share Posted July 8, 2019 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now