publicVariableClient: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - ">Posted on April ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-04-$1") |
Lou Montana (talk | contribs) m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>") |
||
(One intermediate revision by the same user not shown) | |||
Line 50: | Line 50: | ||
<dd class="note"> | <dd class="note"> | ||
While [[publicVariable]] is JIP compatible and persistent, [[publicVariableClient]] is not. If you log out then log in with the same owner id the public variable sent to your client prior will be [[nil]]. | While [[publicVariable]] is JIP compatible and persistent, [[publicVariableClient]] is not. If you log out then log in with the same owner id the public variable sent to your client prior will be [[nil]]. | ||
<sqf>//server | <sqf> | ||
//server | |||
pv = 123; | pv = 123; | ||
3 publicVariableClient "pv"; | 3 publicVariableClient "pv"; | ||
Line 59: | Line 60: | ||
// | // | ||
//client id is still 3 | //client id is still 3 | ||
hint str pv; //error, undefined variable pv</sqf> | hint str pv; //error, undefined variable pv | ||
</sqf> | |||
<dt></dt> | <dt></dt> | ||
<dd class="notedate">Posted on 2015-04-12 - 09:27 (UTC)</dd> | <dd class="notedate">Posted on 2015-04-12 - 09:27 (UTC)</dd> | ||
<dt class="note">[[User: | <dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
Tested in Arma 3 v1.43, [[publicVariableClient]] works client-to-client if [[owner]] id of the targeted client is known. | Tested in Arma 3 v1.43, [[publicVariableClient]] works client-to-client if [[owner]] id of the targeted client is known. |
Latest revision as of 19:42, 3 September 2024
Description
- Description:
- Send the variable value to the client computer - same limitations regarding variable type as publicVariable.
The Client ID is the temporary ID given to a connected client for that session. You can find out this ID with the owner command (using it on a player's character, for example, will give you that players client ID).
- Groups:
- MultiplayerVariables
Syntax
- Syntax:
- clientID publicVariableClient varName
- Parameters:
- clientID: Number
- varName: String
- Return Value:
- Nothing
Examples
- Example 1:
- 3 publicVariableClient "CTFscoreOne";
Additional Information
- See also:
- clientOwner owner publicVariable publicVariableServer addPublicVariableEventHandler remoteExecutedOwner
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on 24 Aug, 2012
- Kylania
-
publicVariableServer (run on client)
publicVariableClient (run on server)
Publishes a variable (name as STRING) to a specific client, from the server. This is useful where you want to synchronize a variable with only a specific client.
This is a useful way to cut down on network traffic, as publicVariable commands are issued as a priority message. So use publicVariable sparingly, and these commands where they apply. - Rocket - Posted on 21 Sep, 2013
- Killzone_Kid
- While publicVariable is JIP compatible and persistent, publicVariableClient is not. If you log out then log in with the same owner id the public variable sent to your client prior will be nil.
- Posted on 2015-04-12 - 09:27 (UTC)
- Killzone_Kid
- Tested in Arma 3 v1.43, publicVariableClient works client-to-client if owner id of the targeted client is known.