GSC reference › Built-in
associativeArray()
Built-in (engine)
Server + client
Utility
Creates an associativeArray
Signature
associativeArray([key_i], [value_i])
Parameters
| Name | Required? | Details |
|---|---|---|
| key_i | Optional | the string key for the next value |
| value_i | Optional | the value for the previous key |
Real uses in BO3's scripts
Called 11 times in the decompiled scripts. A few, zombies first:
- scripts/shared/_character_customization.csc, line 51
level.intercom_dialog = associativearray("helmet", "", "head", ""); - scripts/shared/end_game_taunts.csc, line 626
if(isdefined(associativearray("weapon_smg", array("pb_smg_endgame_1stplace_idle", "pb_smg_endgame_2ndplace_idle", "pb_smg_endgame_3rdplac... - scripts/shared/lui_shared.csc, line 39
level.client_menus = associativearray(); - scripts/mp/killstreaks/_killstreakrules.gsc, line 335
player.killstreakevents = associativearray(); - scripts/mp/killstreaks/_killstreaks.gsc, line 1484
player.killstreakevents = associativearray();
Related built-ins
- array()Create an array
- Assert()Assert that the given statement is correct.
- GetDvarInt()Gets the value of a dvar.
- IsArray()Checks whether this entity/variable is an array
- GetDvarString()Gets the value of a dvar.
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- GetDvarFloat()Gets the value of a dvar.
- IsSubStr()Returns true/false if <substring> is a substring of <string>.
- GetArrayKeys()Returns an array consisting of the keys of the input array.
- 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
- StrTok()Tokenizes <string> by the delimiters <delim>.
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).