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
@name Namer-Test-Code | |
@persist ENTITY:entity [BigString1 BigString2]:string | |
if (first()) | |
{ | |
ENTITY = entity() | |
print("Test: entity:setName(string)") | |
print(setName("Namer-Test-Code") == 0) # Pass [initially, the names are the same so it is expected to fail] | |
print(setName("Another E2 Name") == 1) # Pass [name is successfully changed] |
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 assert, Color, IsColor, isnumber, isstring, tonumber = assert, Color, IsColor, isnumber, isstring, tonumber | |
local bit = bit | |
local bit_band, bit_bor, bit_lshift, bit_rshift = bit.band, bit.bor, bit.lshift, bit.rshift | |
local string = string | |
local string_byte, string_char, string_format, string_len = string.byte, string.char, string.format, string.len | |
local BYTE_MAX, UINT32_MAX = 0xFF, 0xFFFFFFFF -- Max value of unsigned byte. Max value of 32-bit unsigned integer. | |
--local UINT64_MAX = 0xFFFFFFFFFFFFFFFF -- Max value of 64-bit unsigned integer. | |
--- Packs a [Color] structure into a 32-bit unsigned integer. |
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
newmtl M_0077_DarkGreen | |
Kd 0.509804 0.6666667 0.3490196 | |
illum 2 |
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
### <copyright>Copyright (c) 2016 https://github.com/CaptainPRICE. All rights reserved.</copyright> | |
### <license>MIT license (see "LICENSE.md" file).</license> | |
### <dependency>holo</dependency> | |
### <contributors>github.com/CaptainPRICE (https://steamcommunity.com/profiles/76561198092225548/)</contributors> | |
@name Hologram Are Fun v1 | |
#ifdef holoCreate(number) | |
@persist Holograms:array IsDone LastHoloID MaxAmount StartedTime SpawnedCount NAME:string | |
@trigger none | |
@model models/led.mdl |
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
# A single function to rule everything about entity searching. | |
# (1) array/entity: Player(s) to search the entities of. | |
# (2) array/string: Parameter to be used with search. | |
# (3) number: Type of search to be executed (valid values: _FIND_BY_CLASS, _FIND_BY_MODEL, _FIND_BY_NAME). | |
# Examples: | |
entsByPlayer(owner(), "*", _FIND_BY_CLASS) # Gets all entities owned by you. | |
entsByPlayer(playersAdmins(), "*", _FIND_BY_CLASS) # Gets all entities that are owned by all admins. | |
entsByPlayer(owner(), array("prop_*", "gmod_wire_expression2"), _FIND_BY_CLASS) # Gets all entities that you own, and whose class name matches any of the strings (specified by 2nd argument). |
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 setmetatable = setmetatable | |
Default, Nil = {}, function() end | |
switch = function(i) | |
return setmetatable({ i }, { | |
__call = function(t, cases) | |
local item = #t < 1 and Nil or t[1] | |
return (cases[item] or cases[Default] or Nil)(item) | |
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
local NODES = { | |
Branch_1 = { | |
Sibling_1 = { | |
item_1 = "a string value", | |
item_2 = 2, | |
item_3 = "another string value" | |
}, | |
Sibling_2 = { | |
grandchild_1 = { | |
item_1 = 123.456789 |
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
function vector average(Vector1:vector, Vector2:vector) | |
{ | |
return (Vector1 + Vector2) * 0.5 | |
} | |
function vector average(Vector1:vector, Vector2:vector, Vector3:vector) | |
{ | |
return (Vector1 + Vector2 + Vector3) / 3 | |
} |
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 math = math | |
local math_floor = math.floor | |
local error, setmetatable, rawget, tostring, type = error, setmetatable, rawget, tostring, type | |
int = {} | |
do | |
local INT32, INT32_NAME, INT32_SIZE, INT32_DEFAULT, INT32_MAX, INT32_MIN = 3, "int32", 32, 0, 2147483648, -2147483648 | |
local int32 = { | |
__metatable = false, |