我正在为 Garry 的 Mod 制作一个脚本,它几乎完成了,但由于某种原因,当我输入新的 Cvar 时,我让它不会改变 host_framerate。如果有人知道问题是你的救命稻草。
local speedCvar = CreateClientConVar( "speedhack_enabled", 0, true, false )
local speedHackCvar = CreateClientConVar( "speedhack_enabled", "0", true, false )
local speedHack = SpeedHackCvar:GetString()
local speed = function()
if (speedCvar:GetInt() == 1) then
speedHack = SpeedHackCvar:GetString()
RunConsoleCommand("host_framerate", speedHack)
else
speedHack = SpeedHackCvar:GetString()
RunConsoleCommand("host_framerate " , speedHack)
end
end