GSC reference › Built-in
CodeSetClientField()
Built-in (engine)
Server
Sets the value for a given client field.
Signature
CodeSetClientField(<entity>, <name>, <value>)
Parameters
| Name | Required? | Details |
|---|---|---|
| entity | Required | An entity |
| name | Required | Unique name to identify the field. |
| value | Required | Value to transmit. |
Example (from Treyarch's docs)
CodeSetClientField(ent, "my_field", 1)
Real uses in BO3's scripts
Called 15 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_perk_electric_cherry.gsc, line 591
codesetclientfield(self, "electric_cherry_reload_fx", 1); - scripts/shared/clientfield_shared.gsc, line 35
codesetclientfield(self, str_field_name, n_value); - scripts/mp/gametypes/_globallogic.gsc, line 5059
codesetclientfield(self, "annihilate_effect", 1); - scripts/cp/gametypes/_globallogic_player.gsc, line 2570
codesetclientfield(body, "hide_body", 1); - scripts/cp/gametypes/_killcam.gsc, line 321
codesetclientfield(body, "hide_body", 0);
Related built-ins
- setupclientfieldcodecallbacks()Registers a LUI code callback for each of the given clientfield names in a field pool.
- CodeSetUIModelClientField()Sets the value for a given player uimodel client field.
- CodeSetPlayerStateClientField()Sets the value for a given player state client field.
- CodeSetWorldClientField()Sets the value for a given world client field.
- SetupClientFieldAnimSpeedCallbacks()Registers a code callback for each of the given clientfield names in a field pool.
- SetupClientFieldLuiCodeCallbacks()Registers a LUI code callback for each of the given clientfield names in a field pool.
- RegisterClientField()Register a client field.
- SetClientUIVisibilityFlag()Sets a HUD visibility flag only on this client
- SetClientNameMode()Alters the way that the player name is updated, to prevent cheating by spectators altering their name to communicate with active players.
- SetClientThirdPerson()Set the client to be third person
- SetDepthOfField()Set the Depth of Field.
- SetClientScriptMainMenu()Sets g_scriptMainMenu dvar only on this client
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).