Skip to content

Commit

Permalink
entities() E2 function (#3257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Astralcircle authored Feb 14, 2025
1 parent f182ffd commit dbed3cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/entities/gmod_wire_expression2/core/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ e2function entity entity:owner()
return getOwner(self, this)
end

__e2setcost(100)

e2function array entities()
local entities = ents.GetAll()
self.prf = self.prf + #entities / 2

return entities
end

__e2setcost(20)

e2function table entity:keyvalues()
Expand Down
1 change: 1 addition & 0 deletions lua/wire/client/e2descriptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ E2Helper.Descriptions["hashSHA256(s)"] = "Returns the SHA256 hash of the input s

-- Entity/Player
E2Helper.Descriptions["entity(n)"] = "Gets the entity associated with the id"
E2Helper.Descriptions["entities()"] = "Returns an array containing all entities on the map"
E2Helper.Descriptions["owner()"] = "Gets the owner of the expression ( same as entity():owner() )"
E2Helper.Descriptions["id(e:)"] = "Gets the numeric id of an entity"
E2Helper.Descriptions["noentity()"] = "Returns an invalid entity"
Expand Down

0 comments on commit dbed3cf

Please sign in to comment.