Skip to content

API functions

Nazar edited this page Apr 20, 2026 · 5 revisions

API functions

Note

It's important to understand that all calls to the functions provided here go through the nixware table.


nixware.klog(string message)

sends a message to Logs (Misc -> Globals -> Logs)

return: none

Example:

hook.Add("OnPlayerChat","Checksay",function(ply,text,public)
	if(string.lower( text ) == "hello") then
		nixware.klog(ply:Nick() .. " said hello")
	end
end)

nixware.attach_console()

Opens console if it has not been done before.

return: none


nixware.detach_console()

Close console

return: none


nixware.time_to_tick(int time)

Convert time to tick

return: int ticks

example:

print("time to tick " .. nixware.time_to_tick(100))

nixware.ticks_to_time(int ticks)

convert ticks to time

return: int time

example:

print("tick to time " .. nixware.ticks_to_time(100))

nixware.get_entity_box(entity entity)

get adaptive collision box for entity

return: int left, int top, int right, int bottom

example:

hook.Add("HUDPaint", "esp_boxes", function()
    for _, ply in ipairs(player.GetAll()) do
        if ply == LocalPlayer() then continue end
        if not IsValid(ply) or not ply:Alive() then continue end

        local left, top, right, bottom = nixware.get_entity_box(ply)
        if not left or left == 0 then continue end

        local w = right - left
        local h = top - bottom

        surface.SetDrawColor(255, 0, 0, 255)
        surface.DrawOutlinedRect(left, bottom, w, h)
    end
end)

nixware.set_view_angles(vector angles)

Set the local player's view angles directly via the engine Suitable for simple aimbot

return: none


nixware.get_convar(string name)

Find a convar by name and return a convar object with get/set methods.
Returns nil if the convar does not exist.

return: convar object or nil

Method Description Return
:get_int() Get convar value as integer int
:get_float() Get convar value as float float
:get_string() Get convar value as string string
:set_int(int value) Set convar value as integer none
:set_float(float value) Set convar value as float none
:set_string(string value) Set convar value as string none

example:

local sv_cheats = nixware.get_convar("sv_cheats")
if sv_cheats then
    print("sv_cheats = " .. sv_cheats:get_int())
    sv_cheats:set_int(1)
end

local sens = nixware.get_convar("sensitivity")
if sens then
    print("sensitivity = " .. sens:get_float())
    sens:set_float(2.5)
end

-- returns nil if convar does not exist
local fake = nixware.get_convar("does_not_exist")
if not fake then
    print("convar not found")
end

cmd table


nixware.cmd.get_mouse_x()

Get current mouse X delta from the user command. return: int


nixware.cmd.get_mouse_y()

Get current mouse Y delta from the user command.

return: int


nixware.cmd.get_buttons()

Get the current button bitfield from the user command.

return: int

example:

hook.Add("CreateMove", "check_jump", function()
    local buttons = nixware.cmd.get_buttons()
    if bit.band(buttons, IN_JUMP) ~= 0 then
        print("player is pressing jump")
    end
end)

nixware.cmd.get_command_number()

Get the current command number from the user command.

return: int


nixware.cmd.cmd_set_view_angles(vector angles)

Set view angles directly in the user command (affects movement direction).

return: none

Note

not tested