问题
这行代码中哪里可以改键位,怎么改local handsonhead = false
RegisterCommand("handsonhead", function()
handonhead()
end)
RegisterKeyMapping("handsonhead", "Hands on head", "keyboard", "Z")
function handonhead()
while not HasAnimDictLoaded("random@arrests@busted") do
RequestAnimDict("random@arrests@busted")
Citizen.Wait(5)
end
if not handsonhead then
handsonhead = true
TaskPlayAnim(PlayerPedId(), "random@arrests@busted", "idle_c", 3.0, 1.0, -1, 50, 0, false, false, false)
else
handsonhead = false
ClearPedTasks(PlayerPedId())
end
end
在这段代码中,您可以通过修改 `RegisterKeyMapping` 函数中的最后一个参数来更改键位。当前的代码是:
RegisterKeyMapping("handsonhead", "Hands on head", "keyboard", "Z")
这里的 `"Z"` 是当前绑定的键位。如果您想更改为其他键位,例如 `"X"`,您只需将其替换为:
RegisterKeyMapping("handsonhead", "Hands on head", "keyboard", "X")
这样,您就可以通过按下新指定的键位来触发 `handsonhead` 命令。
页:
[1]