Skip to content

Callbacks

draw

This callback will be executed in game thread, it allows you do draw any primitives and has safe access to any game functions.

Cheat.RegisterCallback("draw", function()
    -- here is your code
end)

pre_prediction

CreateMove callback before cheat prediction, if you need to modify something before prediction and/or aimbot/antiaims/etc, you can do it there.

Cheat.RegisterCallback("pre_prediction", function(cmd, local_player)
    -- here is your code
end)

prediction

CreateMove callback inside cheat prediction, if you need to modify something inside prediction and/or before aimbot/antiaims/etc, you can do it there.

Cheat.RegisterCallback("prediction", function(cmd, local_player)
    -- here is your code
end)

create_move

CreateMove callback after cheat prediction.

Cheat.RegisterCallback("create_move", function(cmd, local_player)
    -- here is your code
end)

destroy

This callback will be called before script unload, so you can revert changes inside this callback.

local panorama_disable_blur = CVar.FindVar("@panorama_disable_blur")
panorama_disable_blur:SetInt(1)

Cheat.RegisterCallback("destroy", function()
    panorama_disable_blur:SetInt(0)
end)

frame_stage

This callback will be executed on every frame stage.

Cheat.RegisterCallback("frame_stage", function(stage)
    -- here is your code
end)

console

This callback will be executed before a string command (chat messages, weapon inspecting, buy commands) is sent to the server.

Cheat.RegisterCallback("console", function(text)
    print("Input text was: '" .. text .. "'")
end)

override_view

This callback will be executed when game is calculating view.

Cheat.RegisterCallback("override_view", function(setup)
    print("field of view is " .. tostring(setup.fov))
end)

player_chat

This callback will be executed when a player sends a message to chat.

Cheat.RegisterCallback("player_chat", function(teamonly, entity, name, text)
    print(name .. " wrote " .. text)
end)