GSC reference › Built-in
GetArrayKeys()
Built-in (engine)
Server + client
Utility
Returns an array consisting of the keys of the input array.
Signature
GetArrayKeys(<array>)
Parameters
| Name | Required? | Details |
|---|---|---|
| array | Required | Input array |
Returns
Returns an array consisting of the keys of the input array.
Example (from Treyarch's docs)
result = GetArrayKeys( array )
Real uses in BO3's scripts
Called 325 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm.gsc, line 3241
stored_weapon_info = getarraykeys(self.stored_weapon_info); - scripts/zm/_zm_ai_monkey.gsc, line 1160
keys = getarraykeys(level.monkey_perks); - scripts/zm/_zm_ai_napalm.gsc, line 452
keys = getarraykeys(fx); - scripts/zm/_zm_ai_raps.gsc, line 711
keys = getarraykeys(level.zones); - scripts/zm/_zm_ai_wasp.gsc, line 570
keys = getarraykeys(level.zones);
Related built-ins
- array()Create an array
- IsArray()Checks whether this entity/variable is an array
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- ArrayCombine()Combine two arrays into and returns one new array
- IsInArray()Searches an array to determine if a given value is present in that array
- ArrayGetClosest()Returns the entity/vector that is closest to the <origin> from the <array>.
- ArrayRemoveIndex()Remove a value from an array at a given index
- ArrayCopy()Returns a copy of an array
- ArrayInsert()Insert a value into an array at a given index
- associativeArray()Creates an associativeArray
- ArrayGetFarthest()Returns the entity/vector that is farthest to the <origin> from the <array>.
- ArrayIntersect()Returns an array of values that are present in both arrays.
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).