fairyoggy Posted July 8, 2019 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)
fairyoggy Posted July 8, 2019 Author 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 .
HassoN Posted July 8, 2019 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.
fairyoggy Posted July 8, 2019 Author 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?
HassoN Posted July 8, 2019 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
Scripting Moderators Sarrum Posted July 8, 2019 Scripting Moderators Posted July 8, 2019 You can't change the bind.
fairyoggy Posted July 8, 2019 Author Posted July 8, 2019 11 minutes ago, Sarrum said: You can't change the bind. Is the person from the top wrong or misunderstood?
Scripting Moderators Sarrum Posted July 8, 2019 Scripting Moderators Posted July 8, 2019 13 minutes ago, slapz0r said: Is the person from the top wrong or misunderstood? Yeah, he probably misunderstood you.
fairyoggy Posted July 8, 2019 Author 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?
HassoN Posted July 8, 2019 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.
fairyoggy Posted July 8, 2019 Author 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"
HassoN Posted July 8, 2019 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.
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