<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Walman10</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Walman10"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Walman10"/>
	<updated>2026-05-24T04:24:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=44551</id>
		<title>Help:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=44551"/>
		<updated>2015-02-12T19:55:45Z</updated>

		<summary type="html">&lt;p&gt;Walman10: /* Questions? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see &amp;lt;nowiki&amp;gt;{{weird_tags_like_this}}&amp;lt;/nowiki&amp;gt; instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in [[Special:RecentChanges|RecentChanges]] that people are making pages and not linking to them properly. '''These pages are being lost in the bowels of the Wiki!'''&lt;br /&gt;
&lt;br /&gt;
We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly.&lt;br /&gt;
&lt;br /&gt;
=Template=&lt;br /&gt;
===What is a Template===&lt;br /&gt;
It is like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page.&lt;br /&gt;
&lt;br /&gt;
*'''Why Use Templates?'''&lt;br /&gt;
It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times.&lt;br /&gt;
&lt;br /&gt;
*'''Example?''' &lt;br /&gt;
Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the &amp;quot;See Also&amp;quot; section of individual functions with their related functions.&lt;br /&gt;
&lt;br /&gt;
===How Do You Make/Edit/Use a Template?===&lt;br /&gt;
&lt;br /&gt;
The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN!&lt;br /&gt;
&lt;br /&gt;
====1. Choosing a Template Name====&lt;br /&gt;
The best template name explains what it is. Typically the best thing is to make the template URL identical to the actual page. Therefore I am going to use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:''' Remember that all wiki pages are case sensitive. The same page can exist in uppercase and lowercase! Capitalize appropriately.&lt;br /&gt;
&lt;br /&gt;
If I tried to link to a template that doesn't exist this happens:&lt;br /&gt;
{{link_to_nonexistant_template_click_here_to_create_lazypants0}}&lt;br /&gt;
&lt;br /&gt;
So as you can see, it is better we create the template before attempting to link to it!&lt;br /&gt;
&lt;br /&gt;
====2. Filling out the Template====&lt;br /&gt;
&lt;br /&gt;
At the template page, hit create page, and you'll see the edit field box. Type in whatever you need to be said in other pages and save the page. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something, such as our future functions template. If you were trying to add to our functions/events then you would just edit a link to your function into the template. Don't screw it up or I will be disappointed in you!&lt;br /&gt;
&lt;br /&gt;
From this point, you use the template page name as a tag inside the pages where you want to use it. My template tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Adding_Pages_to_Categories_and_Templates}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. Demonstration====&lt;br /&gt;
So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below:&lt;br /&gt;
&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The easiest way to reach a template that was used on a page is to edit the page and scroll to the bottom. A list of all templates used will appear with links to the template pages. For something like the main function pages you have to edit the ENTIRE page to see templates used at the bottom, they do not appear if you only edit a section.&lt;br /&gt;
&lt;br /&gt;
=Category=&lt;br /&gt;
===What is a Category===&lt;br /&gt;
Categories group pages together. The categories have their own special page where all the grouped pages are alphabetized. Think of them like sorting the Wiki into folders for common pages. For example here is a link to the server functions category page: [[:Category:Server_functions]]&lt;br /&gt;
&lt;br /&gt;
===How do I Make/Edit/Use Categories===&lt;br /&gt;
A page is put into a category by editing the following syntax into a page:&lt;br /&gt;
&amp;lt;pre&amp;gt;[[:Category:pagename]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You do need to create the category page just as you would a template. Again, you simply go to the URL of the category page you want to make. The format is:&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Category:Page_Name_Here&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the category page itself, you simply write a small explanation what the category (folder) is about.&lt;br /&gt;
&lt;br /&gt;
If you look at the source of the pages listed in [[:Category:Server_functions]], you may notice that the category tag is not in them! It actually is there, but it is being applied through the clever combination of a template with the category embedded.&lt;br /&gt;
&lt;br /&gt;
Those nice colored stripes you see at the tops of pages are all templates that have a category tag embedded. This was designed to make it hard for people to mess-up categories. For example, look at the page source for the blue stripe that says &amp;quot;Client and Server Function&amp;quot; http://wiki.multitheftauto.com/index.php?title=Template:Server_client_function&amp;amp;action=edit&lt;br /&gt;
&lt;br /&gt;
===Demonstration===&lt;br /&gt;
I have put a category tag in this page. This is reflected at the very bottom of the page you are reading right now. The category page just happens to be the exact same name. Unlike templates, it is not typical to name the category after a page. They are more like folder names. This is just for demonstration however.&lt;br /&gt;
&lt;br /&gt;
The category page is here: [[:Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
=More Info=&lt;br /&gt;
===Lists of Templates and Categories===&lt;br /&gt;
Looking for template and category listings? This is one thing [[Special:SpecialPages|SpecialPages]] is for.&lt;br /&gt;
&lt;br /&gt;
'''Templates:'''&lt;br /&gt;
*[[Special:UncategorizedTemplates]]&lt;br /&gt;
:Templates not organized into templates (ie think of categories as folders).&lt;br /&gt;
*[[Special:UnusedTemplates]]&lt;br /&gt;
:Unused templates&lt;br /&gt;
*[[Special:WantedTemplates]]&lt;br /&gt;
:Tags are linked to this template, but the page itself doesn't exist. It still works de facto. You need to hit create on the template page.&lt;br /&gt;
*[[Special:MostLinkedTemplates]]&lt;br /&gt;
:Templates that were tagged in the most pages&lt;br /&gt;
&lt;br /&gt;
'''Categories:'''&lt;br /&gt;
*[[Special:Categories]]&lt;br /&gt;
:All categories overview.&lt;br /&gt;
*[[Special:UncategorizedCategories]]&lt;br /&gt;
:Categories not within another category (ie not used as subfolders of folders).&lt;br /&gt;
*[[Special:UnusedCategories]]&lt;br /&gt;
:Unused categories&lt;br /&gt;
*[[Special:WantedCategories]]&lt;br /&gt;
:Tags are linked to this category, but the page itself doesn't exist. It still works de facto. You need to hit create on the category page.&lt;br /&gt;
*[[Special:MostLinkedCategories]]&lt;br /&gt;
:Categories that were tagegd in the most places&lt;br /&gt;
&lt;br /&gt;
===Further Reference===&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Template&amp;lt;br&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Category&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
[[MTA_Wiki:Editing_Guidelines]] - This is a complete overview of how we use Wiki for MTA, this was only part of it. Please read this!&lt;br /&gt;
&lt;br /&gt;
===Questions?===&lt;br /&gt;
Best way to discuss wiki is live on IRC. See the community box on the [[Main Page]] for more info.&lt;br /&gt;
&lt;br /&gt;
[[Category:MTA Wiki:Editing]]&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Walman10</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=44550</id>
		<title>Help:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=44550"/>
		<updated>2015-02-12T19:55:32Z</updated>

		<summary type="html">&lt;p&gt;Walman10: /* Questions? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see &amp;lt;nowiki&amp;gt;{{weird_tags_like_this}}&amp;lt;/nowiki&amp;gt; instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in [[Special:RecentChanges|RecentChanges]] that people are making pages and not linking to them properly. '''These pages are being lost in the bowels of the Wiki!'''&lt;br /&gt;
&lt;br /&gt;
We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly.&lt;br /&gt;
&lt;br /&gt;
=Template=&lt;br /&gt;
===What is a Template===&lt;br /&gt;
It is like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page.&lt;br /&gt;
&lt;br /&gt;
*'''Why Use Templates?'''&lt;br /&gt;
It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times.&lt;br /&gt;
&lt;br /&gt;
*'''Example?''' &lt;br /&gt;
Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the &amp;quot;See Also&amp;quot; section of individual functions with their related functions.&lt;br /&gt;
&lt;br /&gt;
===How Do You Make/Edit/Use a Template?===&lt;br /&gt;
&lt;br /&gt;
The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN!&lt;br /&gt;
&lt;br /&gt;
====1. Choosing a Template Name====&lt;br /&gt;
The best template name explains what it is. Typically the best thing is to make the template URL identical to the actual page. Therefore I am going to use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:''' Remember that all wiki pages are case sensitive. The same page can exist in uppercase and lowercase! Capitalize appropriately.&lt;br /&gt;
&lt;br /&gt;
If I tried to link to a template that doesn't exist this happens:&lt;br /&gt;
{{link_to_nonexistant_template_click_here_to_create_lazypants0}}&lt;br /&gt;
&lt;br /&gt;
So as you can see, it is better we create the template before attempting to link to it!&lt;br /&gt;
&lt;br /&gt;
====2. Filling out the Template====&lt;br /&gt;
&lt;br /&gt;
At the template page, hit create page, and you'll see the edit field box. Type in whatever you need to be said in other pages and save the page. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something, such as our future functions template. If you were trying to add to our functions/events then you would just edit a link to your function into the template. Don't screw it up or I will be disappointed in you!&lt;br /&gt;
&lt;br /&gt;
From this point, you use the template page name as a tag inside the pages where you want to use it. My template tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Adding_Pages_to_Categories_and_Templates}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. Demonstration====&lt;br /&gt;
So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below:&lt;br /&gt;
&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The easiest way to reach a template that was used on a page is to edit the page and scroll to the bottom. A list of all templates used will appear with links to the template pages. For something like the main function pages you have to edit the ENTIRE page to see templates used at the bottom, they do not appear if you only edit a section.&lt;br /&gt;
&lt;br /&gt;
=Category=&lt;br /&gt;
===What is a Category===&lt;br /&gt;
Categories group pages together. The categories have their own special page where all the grouped pages are alphabetized. Think of them like sorting the Wiki into folders for common pages. For example here is a link to the server functions category page: [[:Category:Server_functions]]&lt;br /&gt;
&lt;br /&gt;
===How do I Make/Edit/Use Categories===&lt;br /&gt;
A page is put into a category by editing the following syntax into a page:&lt;br /&gt;
&amp;lt;pre&amp;gt;[[:Category:pagename]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You do need to create the category page just as you would a template. Again, you simply go to the URL of the category page you want to make. The format is:&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Category:Page_Name_Here&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the category page itself, you simply write a small explanation what the category (folder) is about.&lt;br /&gt;
&lt;br /&gt;
If you look at the source of the pages listed in [[:Category:Server_functions]], you may notice that the category tag is not in them! It actually is there, but it is being applied through the clever combination of a template with the category embedded.&lt;br /&gt;
&lt;br /&gt;
Those nice colored stripes you see at the tops of pages are all templates that have a category tag embedded. This was designed to make it hard for people to mess-up categories. For example, look at the page source for the blue stripe that says &amp;quot;Client and Server Function&amp;quot; http://wiki.multitheftauto.com/index.php?title=Template:Server_client_function&amp;amp;action=edit&lt;br /&gt;
&lt;br /&gt;
===Demonstration===&lt;br /&gt;
I have put a category tag in this page. This is reflected at the very bottom of the page you are reading right now. The category page just happens to be the exact same name. Unlike templates, it is not typical to name the category after a page. They are more like folder names. This is just for demonstration however.&lt;br /&gt;
&lt;br /&gt;
The category page is here: [[:Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
=More Info=&lt;br /&gt;
===Lists of Templates and Categories===&lt;br /&gt;
Looking for template and category listings? This is one thing [[Special:SpecialPages|SpecialPages]] is for.&lt;br /&gt;
&lt;br /&gt;
'''Templates:'''&lt;br /&gt;
*[[Special:UncategorizedTemplates]]&lt;br /&gt;
:Templates not organized into templates (ie think of categories as folders).&lt;br /&gt;
*[[Special:UnusedTemplates]]&lt;br /&gt;
:Unused templates&lt;br /&gt;
*[[Special:WantedTemplates]]&lt;br /&gt;
:Tags are linked to this template, but the page itself doesn't exist. It still works de facto. You need to hit create on the template page.&lt;br /&gt;
*[[Special:MostLinkedTemplates]]&lt;br /&gt;
:Templates that were tagged in the most pages&lt;br /&gt;
&lt;br /&gt;
'''Categories:'''&lt;br /&gt;
*[[Special:Categories]]&lt;br /&gt;
:All categories overview.&lt;br /&gt;
*[[Special:UncategorizedCategories]]&lt;br /&gt;
:Categories not within another category (ie not used as subfolders of folders).&lt;br /&gt;
*[[Special:UnusedCategories]]&lt;br /&gt;
:Unused categories&lt;br /&gt;
*[[Special:WantedCategories]]&lt;br /&gt;
:Tags are linked to this category, but the page itself doesn't exist. It still works de facto. You need to hit create on the category page.&lt;br /&gt;
*[[Special:MostLinkedCategories]]&lt;br /&gt;
:Categories that were tagegd in the most places&lt;br /&gt;
&lt;br /&gt;
===Further Reference===&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Template&amp;lt;br&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Category&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
[[MTA_Wiki:Editing_Guidelines]] - This is a complete overview of how we use Wiki for MTA, this was only part of it. Please read this!&lt;br /&gt;
&lt;br /&gt;
===Questions?===&lt;br /&gt;
Best way to discuss wiki is live on IRC. See the community box on the [[Main Page]] for more info. test&lt;br /&gt;
&lt;br /&gt;
[[Category:MTA Wiki:Editing]]&lt;br /&gt;
[[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Walman10</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BindControlKeys&amp;diff=42848</id>
		<title>BindControlKeys</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BindControlKeys&amp;diff=42848"/>
		<updated>2014-11-14T13:28:10Z</updated>

		<summary type="html">&lt;p&gt;Walman10: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
These useful clientside functions bind the keys bound to a control individually, using [[bindKey]], and unbind them using [[unbindKey]]. The objective of these functions is to bypass the limitation of binding a control directly which ignores key presses if the control is deactivated at the moment (so the script would be able to react if the player presses ''aim_weapon'' in a vehicle, for example).&lt;br /&gt;
&lt;br /&gt;
==Syntaxes==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean/nil bindControlKeys ( string control, misc bindData )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean/nil unbindControlKeys ( string control )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''control:''' The name of the control to bind or unbind. See [[control names]].&lt;br /&gt;
*'''bindData:''' (''bindControlKeys'' only) Configures how the control keys will be bound. See clientside [[bindKey]] syntaxes for reference.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
These functions return ''true'' if no error arised. They return ''nil'' plus an error message otherwise.&lt;br /&gt;
&lt;br /&gt;
==Restrictions==&lt;br /&gt;
'''You can only have one control keys bind per control'''. That should be enough for most scripts. If you want to create more binds, copy these functions into a new script file (or [[resource]]) and mark them as ''local''.&lt;br /&gt;
&lt;br /&gt;
==Functions source==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local controls = { &amp;quot;fire&amp;quot;, &amp;quot;next_weapon&amp;quot;, &amp;quot;previous_weapon&amp;quot;, &amp;quot;forwards&amp;quot;, &amp;quot;backwards&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot;, &amp;quot;zoom_in&amp;quot;, &amp;quot;zoom_out&amp;quot;,&lt;br /&gt;
 &amp;quot;change_camera&amp;quot;, &amp;quot;jump&amp;quot;, &amp;quot;sprint&amp;quot;, &amp;quot;look_behind&amp;quot;, &amp;quot;crouch&amp;quot;, &amp;quot;action&amp;quot;, &amp;quot;walk&amp;quot;, &amp;quot;aim_weapon&amp;quot;, &amp;quot;conversation_yes&amp;quot;, &amp;quot;conversation_no&amp;quot;,&lt;br /&gt;
 &amp;quot;group_control_forwards&amp;quot;, &amp;quot;group_control_back&amp;quot;, &amp;quot;enter_exit&amp;quot;, &amp;quot;vehicle_fire&amp;quot;, &amp;quot;vehicle_secondary_fire&amp;quot;, &amp;quot;vehicle_left&amp;quot;, &amp;quot;vehicle_right&amp;quot;,&lt;br /&gt;
 &amp;quot;steer_forward&amp;quot;, &amp;quot;steer_back&amp;quot;, &amp;quot;accelerate&amp;quot;, &amp;quot;brake_reverse&amp;quot;, &amp;quot;radio_next&amp;quot;, &amp;quot;radio_previous&amp;quot;, &amp;quot;radio_user_track_skip&amp;quot;, &amp;quot;horn&amp;quot;, &amp;quot;sub_mission&amp;quot;,&lt;br /&gt;
 &amp;quot;handbrake&amp;quot;, &amp;quot;vehicle_look_left&amp;quot;, &amp;quot;vehicle_look_right&amp;quot;, &amp;quot;vehicle_look_behind&amp;quot;, &amp;quot;vehicle_mouse_look&amp;quot;, &amp;quot;special_control_left&amp;quot;, &amp;quot;special_control_right&amp;quot;,&lt;br /&gt;
 &amp;quot;special_control_down&amp;quot;, &amp;quot;special_control_up&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
local boundControlsKeys = {}&lt;br /&gt;
local bindsData = {}&lt;br /&gt;
&lt;br /&gt;
function unbindControlKeys(control)&lt;br /&gt;
    -- Ensure the argument has got the appropiate type&lt;br /&gt;
    assert(type(control) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument @ unbindControlKeys [string expected, got &amp;quot; .. type(control) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
    -- Check if we have a valid control&lt;br /&gt;
    local validControl&lt;br /&gt;
    for _, controlComp in ipairs(controls) do&lt;br /&gt;
        if control == controlComp then&lt;br /&gt;
            validControl = true&lt;br /&gt;
            break&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    assert(validControl, &amp;quot;Bad argument @ unbindControlKeys [Invalid control name]&amp;quot;)&lt;br /&gt;
    -- Have we got a bind on this control?&lt;br /&gt;
    assert(boundControlsKeys[control], &amp;quot;Bad argument @ unbindControlKeys [There is no bind on such control]&amp;quot;)&lt;br /&gt;
    -- Unbind each key of the control&lt;br /&gt;
    for _, bindData in pairs(bindsData[control]) do&lt;br /&gt;
        unbindKey(unpack(bindData))&lt;br /&gt;
    end&lt;br /&gt;
    -- Remove references&lt;br /&gt;
    boundControlsKeys[control] = nil&lt;br /&gt;
    bindsData[control] = nil&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function bindControlKeys(control, ...)&lt;br /&gt;
    -- Ensure the argument has got the appropiate type&lt;br /&gt;
    assert(type(control) == &amp;quot;string&amp;quot;, &amp;quot;Bad argument 1 @ bindControlKeys [string expected, got &amp;quot; .. type(control) .. &amp;quot;]&amp;quot;)&lt;br /&gt;
    -- Check if we have a valid control&lt;br /&gt;
    local validControl&lt;br /&gt;
    for _, controlComp in ipairs(controls) do&lt;br /&gt;
        if control == controlComp then -- Is the specified control in the table?&lt;br /&gt;
            validControl = true -- If so, it's a valid control&lt;br /&gt;
            break&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    assert(validControl, &amp;quot;Bad argument 1 @ bindControlKeys [Invalid control name]&amp;quot;)&lt;br /&gt;
    -- Do we already have this control bound?&lt;br /&gt;
    if boundControlsKeys[control] then&lt;br /&gt;
        unbindControlKeys(control) -- Delete the first control keys bind&lt;br /&gt;
    end&lt;br /&gt;
    boundControlsKeys[control] = getBoundKeys(control) -- Store the keys of that control that will be bound&lt;br /&gt;
    bindsData[control] = {} -- Store bind data, so we can unbind each key of the control later&lt;br /&gt;
    for key in pairs(boundControlsKeys[control]) do&lt;br /&gt;
        -- Can we bind the key with the specified arguments?&lt;br /&gt;
        assert(bindKey(key, unpack(arg)), &amp;quot;Bad arguments @ bindControlKeys [Could not create key bind]&amp;quot;)&lt;br /&gt;
        -- If so, register the bind data and continue&lt;br /&gt;
        table.insert(bindsData[control], { key, unpack(arg) })&lt;br /&gt;
    end&lt;br /&gt;
    return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- The keys bound to a control can be changed in Settings. The next function updates the binds properly in that case.&lt;br /&gt;
-- Also note that the next function IS NOT MEANT to be exported or called by the script.&lt;br /&gt;
local function keepControlKeyBindsAccurate()&lt;br /&gt;
    if next(boundControlsKeys) then -- Have we got any control keys bound?&lt;br /&gt;
        for boundControl, boundKeys in pairs(boundControlsKeys) do&lt;br /&gt;
            if toJSON(boundKeys) ~= toJSON(getBoundKeys(boundControl)) then -- Have we changed the keys bound to a control?&lt;br /&gt;
                -- Update our custom control bind&lt;br /&gt;
                for _, bindData in ipairs(bindsData[boundControl]) do&lt;br /&gt;
                    unbindKey(unpack(bindData)) -- Unbind every key of that cotnrol that we have bound before&lt;br /&gt;
                    -- Bind again the appropiate keys&lt;br /&gt;
                    for key in pairs(getBoundKeys(boundControl)) do&lt;br /&gt;
                        local bindDataNoKey = bindData -- Copy bindData into another variable&lt;br /&gt;
                        table.remove(bindDataNoKey, 1) -- Ignore the key of our bindData&lt;br /&gt;
                        bindKey(key, unpack(bindDataNoKey)) -- Bind again the data, but with the updated key&lt;br /&gt;
                        bindData[1] = key -- Update the key in the references&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
                boundControlsKeys[boundControl] = getBoundKeys(boundControl) -- Update the control bound keys list&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientRender&amp;quot;, root, keepControlKeyBindsAccurate)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example allows players to toggle driveby by pressing or releasing the ''aim_weapon'' control.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local function toggleDriveby()&lt;br /&gt;
    if isPedInVehicle(localPlayer) then&lt;br /&gt;
        setPedDoingGangDriveby(localPlayer, not isPedDoingGangDriveby(localPlayer))&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
bindControlKeys(&amp;quot;aim_weapon&amp;quot;, &amp;quot;both&amp;quot;, toggleDriveby)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Walman10</name></author>
	</entry>
</feed>