#
net
Network Manipulation and Exploitation.
#
Functions
net.bsendpacket(state: boolean?): boolean
- This changes if source engine should send movement packets or not.
- The returned
boolean
is the last state that bsendpacket was set to. - Not providing anything will simply return the state.
net.choked(): number
- The amount of movement commands that have been choked before sending again
net.setcvar(cvar: string, value: string)
- Allows you to set a network variable (cvar) to a specified value.
secret.net.setcvar("name", "secretservice agent")
net.disconnect(reason: string)
- Allows you to disconnect from a server with a custom disconnect reason.
net.stringcmd(cmd: string)
- Allows to send a string command from the client to the server.
net.block(cmd: string, writestring: boolean)
- Allows you to block a net message from being sent.
secret.net.block("anticheat_ban", false) -- this blocks net.Start, true will block net.WriteString
net.unblock(cmd: string, writestring: boolean)
- Allows you to unblock a blocked net message.
secret.net.unblock("anticheat_ban", false) -- this unblocks net.Start, true will unblock net.WriteString
net.get_latency(flow: number): number
- Returns the current network latency for the specified direction.
flow
must be0
(outgoing) or1
(incoming). Any invalid value defaults to0
.
local latency_out = secret.net.get_latency(0) -- gets outgoing latency
local latency_in = secret.net.get_latency(1) -- gets incoming latency
misc.server_time(offset: number): number
- Returns the predicted server time based on the local player’s
tickbase
. - If offset is provided, it shifts the tickbase by that amount.
-- get current predicted server time
local time = secret.misc.server_time()
-- get server time 2 ticks ahead
local future = secret.misc.server_time(2)
print("current:", time, "future:", future)