This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MakeTrail = MakeTrail or util.SpriteTrail | |
| local sbox_maxtrails_global = CreateConVar("sbox_maxtrails_global", "32", { FCVAR_ARCHIVE, FCVAR_NOTIFY }, "Limits the global amount of trails (This is NOT a per-player limit)", 0) | |
| local sbox_maxtrails = CreateConVar("sbox_maxtrails", "8", { FCVAR_ARCHIVE, FCVAR_NOTIFY }, "Limits the per-play amount of trails", 0) | |
| local sbox_maxtrail_resolution = CreateConVar("sbox_maxtrail_resolution", tostring(1 / 128), { FCVAR_ARCHIVE, FCVAR_NOTIFY }, "Limits the resolution (segments) of trails", 0, 1) | |
| local sbox_maxtrail_lifetime = CreateConVar("sbox_maxtrail_lifetime", "3", { FCVAR_ARCHIVE, FCVAR_NOTIFY }, "Limits the lifetime of trails (in seconds)", 0, 10) -- The slider in the spawnmenu goes up to 10 seconds | |
| --- @class _G | |
| --- @field TotalTrails number | |
| TotalTrails = TotalTrails or 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- @class DeathText | |
| --- @field Text string | |
| --- @field Origin Vector | |
| --- @field Damage number | |
| --- @field StartTime number | |
| --- @field Squash boolean|nil | |
| --- @type table<Player, DeathText[]> | |
| local Texts = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- @class dlight_t | |
| --- @field brightness number | |
| --- @field decay number | |
| --- @field dietime number | |
| --- @field dir Vector | |
| --- @field innerangle number | |
| --- @field outerangle number | |
| --- @field key number | |
| --- @field minlight number | |
| --- @field noworld boolean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AddCSLuaFile() | |
| DEFINE_BASECLASS( "base_gmodentity" ) | |
| ENT.PrintName = "Lamp" | |
| ENT.Editable = true | |
| AccessorFunc( ENT, "Texture", "FlashlightTexture" ) | |
| -- Set up our data table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local VECTOR = FindMetaTable("Vector") | |
| -- This doesn't cover things like Add, Sub, Mul, Div etc | |
| -- Just poc | |
| local ReadOnly = {} | |
| VECTOR.o__newindex = VECTOR.o__newindex or VECTOR.__newindex | |
| VECTOR.o__gc = VECTOR.o__gc or VECTOR.__gc -- Doesn't exist by default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local ENTITY = FindMetaTable("Entity") | |
| local CSENTITY = FindMetaTable("CSEnt") | |
| local PLAYER = FindMetaTable("Player") | |
| local WEAPON = FindMetaTable("Weapon") | |
| function ENTITY:__tostring() | |
| if not IsValid(self) then | |
| return "Entity [Invalid]" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <string> | |
| #include <xstring> | |
| #include <codecvt> | |
| #include <locale> | |
| #define FOREIGN_OPERATOR(TA, TB) \ | |
| TA& operator += (TB B) \ | |
| { \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ErrorVar = ErrorVar or {} | |
| require("debug") -- https://github.com/bjurd/gm_debug | |
| local _R = debug.getregistry() | |
| ErrorVar.OriginalErrorHandler = ErrorVar.OriginalErrorHandler or _R[1] | |
| function ErrorVar.ErrorHandler(...) | |
| local Level = 1 |