RegisterKeyMapping
клиент REGISTER_KEY_MAPPING
c
void REGISTER_KEY_MAPPING(char* commandString, char* description, char* defaultMapper, char* defaultParameter);Registers a key mapping for the current resource.
See the related cookbook post for more information.
Below you can find some examples on how to create these keybindings as well as the alternate keybinding syntax, which is preceded by ~! to indicate that it's an alternate key.
Параметры
- commandString: The command to execute, and the identifier of the binding.
- description: A description for in the settings menu.
- defaultMapper: The mapper ID to use for the default binding, e.g.
keyboard. - defaultParameter: The IO parameter ID to use for the default binding, e.g.
f3.
Примеры
lua
local handsUp = false
CreateThread(function()
while true do
Wait(0)
if handsUp then
TaskHandsUp(PlayerPedId(), 250, PlayerPedId(), -1, true)
end
end
end)
RegisterCommand('+handsup', function()
handsUp = true
end, false)
RegisterCommand('-handsup', function()
handsUp = false
end, false)
RegisterKeyMapping('+handsup', 'Hands Up', 'keyboard', 'i')
-- Alternate keybinding syntax
RegisterKeyMapping('~!+handsup', 'Hands Up - Alternate Key', 'keyboard', 'o')Страница собрана автоматически из native-decls/RegisterKeyMapping.md. Нашли ошибку — поправьте исходный файл.