-
Notifications
You must be signed in to change notification settings - Fork 0
API functions
Note
It's important to understand that all calls to the functions provided here go through the nixware table.
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)Opens console if it has not been done before.
return: none
Close console
return: none
Convert time to tick
return: int ticks
example:
print("time to tick " .. nixware.time_to_tick(100))convert ticks to time
return: int time
example:
print("tick to time " .. nixware.ticks_to_time(100))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)Set the local player's view angles directly via the engine Suitable for simple aimbot
return: none
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")
endGet current mouse X delta from the user command. return: int
Get current mouse Y delta from the user command.
return: int
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)Get the current command number from the user command.
return: int
Set view angles directly in the user command (affects movement direction).
return: none
Note
not tested