GSC reference › Built-in
GetEntArray()
Built-in (engine)
Server
Looks up entities by key and name and a return an array of the matched entities
Signature
GetEntArray([name], [key], [ignore spawners])
Parameters
| Name | Required? | Details |
|---|---|---|
| name | Optional | name to search for |
| key | Optional | key that name goes with |
| ignore spawners | Optional | if true then you won't get a spawner back |
Returns
entity
Example (from Treyarch's docs)
spawners = GetEntArray( "doorguy1", "targetname" )
Real uses in BO3's scripts
Called 1,419 times in the decompiled scripts. A few, zombies first:
- scripts/mp/_ambient.csc, line 436
fan_array = getentarray(clientnum, "ceiling_fan", "targetname"); - scripts/mp/_destructible.gsc, line 41
destructibles = getentarray("destructible", "targetname"); - scripts/mp/_mgturret.gsc, line 22
turretinfos = getentarray("turretInfo", "targetname"); - scripts/mp/_multi_extracam.csc, line 49
triggers = getentarray(localclientnum, "multicam_enable", "targetname"); - scripts/mp/_perks.csc, line 276
entities = getentarray(local_client_num);
Related built-ins
- GetEntArrayFromArray()Searches given array entities by key and name and a return an array of the matched entities
- GetDamageableEntArray()Returns the entities that can be damaged.
- getdynentarray()Get a dynent array with the specified targetname
- GetTargetLockEntityArray()Get locked target
- GetEntArrayByType()Gets an array of entities that have the given the type of the entity ( for example, ET_MISSILE )
- array()Create an array
- GetEnt()Looks up entities by key and name
- IsArray()Checks whether this entity/variable is an array
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- GetEntityNumber()Get the entity number of the entity
- GetAITeamArray()Returns an array of the human AI and vehicle AI
- GetCurrentWeapon()Gets the current player weapon
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).