vms* store - Docs
Purchase Asset
  • Welcome
  • Official Store
  • Discord
  • Helpful
    • Basic Server Knowledge
      • How to import SQL to database?
      • How to update server artifacts?
    • General Issues
    • Prepared Resources
  • ASSETS
    • vms_notifyV2
      • Installation
      • FAQ
      • Guides
        • Text Formatting
        • Swap in framework
      • Developer API
        • Client Exports
        • Server Events
      • Configuration Files
        • config.lua
        • config.js
    • vms_bossmenu
      • Installation
      • Compatibility
      • FAQ
      • Guides
        • Creating job2 on ESX
        • Paychecks Integration
      • Developer API
        • Client Exports
        • Client Events
        • Server Exports
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
    • vms_cityhall
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Guides
        • License Revocation
        • Personal Taxes Integration
        • Business Taxes Integration
        • Paychecks Integration
        • Add SSN Generation
        • Generate SSN for Players
        • Add VIN Generation
        • Generate VIN for Vehicles
      • Developer API
        • Client Exports
        • Server Exports
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.shared.lua
        • config.clerks.lua
        • config.taxes.lua
        • config.js
    • vms_documentsV2
      • Installation
      • FAQ
      • Common Errors
      • Guides
        • Add SSN Generation
        • Generate SSN for Players
        • Creating New Document
        • Driving School Integration
      • Developer API
        • Client Exports
        • Server Exports
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • metadata.js
    • vms_garagesV2
      • Installation
      • Compatibility
        • Housings
          • qs-housing
          • esx_property
          • bcs_housing
        • Phones
          • yflip-phone
          • qs-smartphone-pro
        • Other
          • VehicleDeformation
          • kq_wheeldamage
      • FAQ
      • Common Errors
      • Guides
        • Interior Stuck Prevention
        • Registering House Garage
      • Developer API
        • Client Exports
        • Server Exports
        • Server Events
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.garages.lua
        • config.management.lua
        • config.parkingcreator.lua
        • config.js
    • vms_houserobberies
      • Installation
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.items.lua
        • config.interiors.lua
        • config.houseslist.lua
        • config.configurator.lua
    • vms_vehicleshopV2
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Guides
        • Adjusting Required Licenses
        • Adjusting orderprice
        • Photos Tool
      • Developer API
        • Client Exports
        • Client Events
        • Server Exports
        • Commands
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
        • config.showroom.lua
        • config.js
    • vms_stores
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.camera.lua
        • config.robbery.lua
        • config.storemanage.lua
        • config.js
    • vms_reports
      • Installation
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.js
    • vms_tuning
      • Installation
      • FAQ
      • Common Errors
      • Guides
        • Garage Integration
          • jg-advancedgarages
        • Understanding Prices
        • Using whitelist & blacklist
        • Fix tuning parts names from NULL
        • Paychecks from the built-in balance
      • Developer API
        • Client Exports
        • Server Exports
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.vehicles.lua
        • config.tuningmenu.lua
        • config.installationparts.lua
        • config.custommods.lua
        • config.missions.lua
    • vms_gym
      • Installation
      • FAQ
      • Common Errors
      • Developer API
        • Client Exports
        • Server Exports
        • Server Events
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
    • vms_hud
      • Installation
      • FAQ
      • Common Errors
      • Developer API
        • Client Exports
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.js
    • vms_spawnselector
      • Installation
      • Compatibility
        • vms_multichars
        • esx_multicharacter
        • esx_identity
        • qb-multicharacter
      • FAQ
      • Developer API
        • Client Exports
        • Server Events
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
    • vms_guidebook
      • Installation
      • Guides
        • Text Formating
      • Developer API
        • Client Exports
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
        • pages.js
    • vms_coinshop
      • Installation
      • Configuration Files
        • config.lua
    • vms_vehicleshop
      • Installation
      • Configuration Files
        • config.lua
    • vms_gangmissions
      • Installation
      • Guides
        • Connection to NPCTALK
      • Configuration Files
        • config.lua
    • vms_charcreator
      • Installation
      • Compatibility
        • vms_multichars
        • esx_multicharacter
        • esx_identity
        • qb-multicharacter
        • ZSX_Multicharacter
        • renzu_multicharacter
      • FAQ
      • Developer API
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
    • vms_clothestore
      • Installation
      • Compatibilty
      • Common Errors
      • Developer API
        • Client Exports
        • Client Events
        • Server Events
      • Configuration Files
        • config.lua
        • config.prices.lua
        • config.js
    • vms_multichars
      • Installation
      • Compatibilty
      • Common Errors
      • Developer API
        • Commands
      • Configuration Files
        • config.lua
        • config_client.lua
        • config_server.lua
        • config_commands.lua
    • vms_identity
      • Installation
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
    • vms_barber
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
    • vms_tattooshop
      • Installation
      • Compatibility
      • FAQ
      • Common Errors
      • Guides
        • New ADD-ON Tattoos
      • Developer API
        • Client Exports
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.management.lua
        • config.tattoos.lua
    • vms_driveschoolV2
      • Installation
      • Compatibility
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
    • vms_boatschoolV2
      • Installation
      • Compatibility
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.routes.lua
    • vms_flightschoolV2
      • Installation
      • Compatibility
      • Common Errors
      • Configuration Files
        • config.lua
        • config.client.lua
        • config.server.lua
        • config.routes.lua
    • vms_documents
      • Installation
      • Guides
        • Adding to radialmenu
        • Usage of documents
        • Adding new documents
      • Configuration Files
        • config.lua
    • vms_anims
      • Installation
      • Guides
        • Adding animations
        • Adding more binds
      • Developer API
        • Client Exports
      • Configuration Files
        • config.lua
        • animations.lua
        • keybinds.lua
    • vms_weaponshop
      • Installation
      • Configuration Files
        • config.lua
    • vms_notify
      • Installation
      • Guides
        • Implementation
        • Replace core notifications
Powered by GitBook
On this page
  • 1. Lua changes - @vms_anims/config/keybinds.lua
  • 2. CSS changes - @vms_anims/html/style.css
  • 3. JS changes - @vms_anims/html/app.js
  • 4. HTML changes - @vms_anims/html/index.html

Was this helpful?

  1. ASSETS
  2. vms_anims
  3. Guides

Adding more binds

1. Lua changes - @vms_anims/config/keybinds.lua

keybinds = {
    [1] = {},
    [2] = {},
    [3] = {},
    [4] = {},
    [5] = {},
    --[6] = {},
    -- If you want to add more keys to bind you can do it here but keep in mind that it will also require changes to the HTML and JS
}
CreateThread(function()
    while true do
        local sleep = 4
        if keybinds[1].key and Keys[keybinds[1].key] then 
            if IsControlJustPressed(0, Keys[keybinds[1].key]) then
                PlayAnimation(false, Animations[tonumber(keybinds[1].animId)])
            end
        end
        --[[
        if keybinds[2].key and Keys[keybinds[2].key] then
            if IsControlJustPressed(0, Keys[keybinds[2].key]) then
                PlayAnimation(false, Animations[tonumber(keybinds[2].animId)])
            end
        end
        ]]
        if 
            not keybinds[1].key
            -- and not keybinds[2].key
        then
            sleep = 5000
        end
        Wait(sleep)
    end
end)

2. CSS changes - @vms_anims/html/style.css

.keybindsMenu {
    [...]
    margin-block: 20%; /* The more the give a lower value to even out the panel */
    height: 375px;/*If you want to add more key binds you need to extend the height*/
}

3. JS changes - @vms_anims/html/app.js

function saveAndLoadAllBinds() {
	const keyBind1 = localStorage.getItem('keybind1')
	const emoteBind1 = localStorage.getItem('emotebind1')
	
	//const keyBind2 = localStorage.getItem('keybind2')
	//const emoteBind2 = localStorage.getItem('emotebind2')
	
	if (keyBind1 && emoteBind1) {
		document.getElementById("kb_animkey-1").value = keyBind1
		document.getElementById("kb_animid-1").value = emoteBind1
		$.post('https://vms_anims/action', JSON.stringify({action: 'keybinds', bindId: 1, key: keyBind1, animId: emoteBind1}));
	} else {
		document.getElementById("kb_animkey-1").value = ""
		document.getElementById("kb_animid-1").value = ""
		$.post('https://vms_anims/action', JSON.stringify({action: 'keybinds', bindId: 1}));
	}
	/*
	
	if (keyBind2 && emoteBind2) {
		document.getElementById("kb_animkey-2").value = keyBind2
		document.getElementById("kb_animid-2").value = emoteBind2
		$.post('https://vms_anims/action', JSON.stringify({action: 'keybinds', bindId: 2, key: keyBind2, animId: emoteBind2}));
	} else {
		document.getElementById("kb_animkey-2").value = ""
		document.getElementById("kb_animid-2").value = ""
		$.post('https://vms_anims/action', JSON.stringify({action: 'keybinds', bindId: 2}));
	}
	
	*/
}

4. HTML changes - @vms_anims/html/index.html

:21 - :34 line to duplicate
<div style="display: inline-flex;margin-block: 5px;">
    <div class="bindKeyBtn">
        <input class="inputKeyAnim" id="kb_animkey-1" maxlength="1" placeholder="KEY"> 
    </div>
    <div class="bindAnimBtn">
        <input class="inputIdAnim" type="number" id="kb_animid-1" placeholder="ID OF ANIMATION">
    </div>
    <div class="saveKeybind" onclick="saveKeybind(1)">
        <span class="material-icons">save</span>
    </div>
    <div class="removeKeybind" onclick="removeKeybind(1)">
        <span class="material-icons">delete</span>
    </div>
</div>
<!--

<div style="display: inline-flex;margin-block: 5px;">
    <div class="bindKeyBtn">
        <input class="inputKeyAnim" id="kb_animkey-2" maxlength="1" placeholder="KEY"> 
    </div>
    <div class="bindAnimBtn">
        <input class="inputIdAnim" type="number" id="kb_animid-2" placeholder="ID OF ANIMATION">
    </div>
    <div class="saveKeybind" onclick="saveKeybind(2)">
        <span class="material-icons">save</span>
    </div>
    <div class="removeKeybind" onclick="removeKeybind(2)">
        <span class="material-icons">delete</span>
    </div>
</div>

-->

Last updated 1 year ago

Was this helpful?