Skip to content

Instantly share code, notes, and snippets.

@CaptainPRICE
Last active November 3, 2016 00:53
Show Gist options
  • Select an option

  • Save CaptainPRICE/da190e6b78c0863ce133b55ce08cf670 to your computer and use it in GitHub Desktop.

Select an option

Save CaptainPRICE/da190e6b78c0863ce133b55ce08cf670 to your computer and use it in GitHub Desktop.
Functions to be added to Expression 2.
# 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment