Skip to content

API functions

Nazar edited this page Apr 19, 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 in seconds

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)

Clone this wiki locally