entities() E2 function (#3257)

This commit is contained in:
Astralcircle 2025-02-14 03:40:00 +03:00 committed by GitHub
parent f182ffdc69
commit dbed3cf164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -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()

View File

@ -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"