getClientState: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game version" to "|Game version=")
m (Text replacement - "(\|[pr][0-9]+ *= *[^-]+) *- *C([a-eg-z])" to "$1 - c$2")
 
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 1.08


|1.08|Game version=
|gr1= Multiplayer
____________________________________________________________________________________________


| Returns client state in network game. Works on both, client and dedicated server. The following states are possible:<br><br>
|descr= Returns client state in network game. Works on both, client and dedicated server. The following states are possible:
<table>
<tr>
<td>[[getClientStateNumber]]&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>[[getClientState]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>'''Description'''</td>
</tr><tr>
<td>0</td>
<td>"NONE"</td>
<td>No client (or singleplayer)</td>
</tr><tr>
<td>1</td>
<td>"CREATED"</td>
<td>Client is created</td>
</tr><tr>
<td>2</td>
<td>"CONNECTED"</td>
<td>Client is connected to server, message formats are registered</td>
</tr><tr>
<td>3</td>
<td>"LOGGED IN"</td>
<td>Identity is created</td>
</tr><tr>
<td>4</td>
<td>"MISSION SELECTED"</td>
<td>Mission is selected</td>
</tr><tr>
<td>5</td>
<td>"MISSION ASKED"</td>
<td>Server was asked to send / not send mission</td>
</tr><tr>
<td>6</td>
<td>"ROLE ASSIGNED"</td>
<td>Role was assigned (and confirmed)</td>
</tr><tr>
<td>7</td>
<td>"MISSION RECEIVED"</td>
<td>Mission received</td>
</tr><tr>
<td>8</td>
<td>"GAME LOADED"</td>
<td>Island loaded, vehicles received</td>
</tr><tr>
<td>9</td>
<td>"BRIEFING SHOWN"</td>
<td>Briefing was displayed</td>
</tr><tr>
<td>10</td>
<td>"BRIEFING READ"</td>
<td>Ready to play mission</td>
</tr><tr>
<td>11</td>
<td>"GAME FINISHED"</td>
<td>Game was finished</td>
</tr><tr>
<td>12</td>
<td>"DEBRIEFING READ"</td>
<td>Debriefing read, ready to continue with next mission</td>
</tr>
</table>|DESCRIPTION=
____________________________________________________________________________________________


| '''getClientState''' |SYNTAX=
{{{!}} class="wikitable"
! [[getClientStateNumber]]
! [[getClientState]]
! Description
{{!}}-
{{!}} 0 {{!}}{{!}} "NONE" {{!}}{{!}} No client (or singleplayer)
{{!}}-
{{!}} 1 {{!}}{{!}} "CREATED" {{!}}{{!}} Client is created
{{!}}-
{{!}} 2 {{!}}{{!}} "CONNECTED" {{!}}{{!}} Client is connected to server, message formats are registered
{{!}}-
{{!}} 3 {{!}}{{!}} "LOGGED IN" {{!}}{{!}} Identity is created
{{!}}-
{{!}} 4 {{!}}{{!}} "MISSION SELECTED" {{!}}{{!}}Mission is selected
{{!}}-
{{!}} 5 {{!}}{{!}} "MISSION ASKED" {{!}}{{!}} Server was asked to send / not send mission
{{!}}-
{{!}} 6 {{!}}{{!}} "ROLE ASSIGNED" {{!}}{{!}} Role was assigned (and confirmed)
{{!}}-
{{!}} 7 {{!}}{{!}} "MISSION RECEIVED" {{!}}{{!}} Mission received
{{!}}-
{{!}} 8 {{!}}{{!}} "GAME LOADED" {{!}}{{!}} Island loaded, vehicles received
{{!}}-
{{!}} 9 {{!}}{{!}} "BRIEFING SHOWN" {{!}}{{!}} Briefing was displayed
{{!}}-
{{!}} 10 {{!}}{{!}} "BRIEFING READ" {{!}}{{!}} Ready to play mission
{{!}}-
{{!}} 11 {{!}}{{!}} "GAME FINISHED" {{!}}{{!}} Game was finished
{{!}}-
{{!}} 12 {{!}}{{!}} "DEBRIEFING READ" {{!}}{{!}} Debriefing read, ready to continue with next mission
{{!}}}


| [[String]] - Client state (see table above)
|s1= [[getClientState]]


|RETURNVALUE=  
|r1= [[String]] - client state (see table above)


|x1= <code>_state = [[getClientState]];</code>|EXAMPLE1=
|x1= <sqf>_state = getClientState;</sqf>
|x2= <code>[[if]] ([[getClientState]] == "BRIEFING READ") [[then]] {[[hint]] "Let the show begin!"};</code>|EXAMPLE1=
____________________________________________________________________________________________


| [[getClientStateNumber]], [[getPlayerUID]] |SEEALSO=  
|x2= <sqf>if (getClientState == "BRIEFING READ") then { hint "Let the show begin!" };</sqf>


| |MPBEHAVIOUR=  
|seealso= [[getClientStateNumber]] [[getPlayerUID]]
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 14:00, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns client state in network game. Works on both, client and dedicated server. The following states are possible:
getClientStateNumber getClientState Description
0 "NONE" No client (or singleplayer)
1 "CREATED" Client is created
2 "CONNECTED" Client is connected to server, message formats are registered
3 "LOGGED IN" Identity is created
4 "MISSION SELECTED" Mission is selected
5 "MISSION ASKED" Server was asked to send / not send mission
6 "ROLE ASSIGNED" Role was assigned (and confirmed)
7 "MISSION RECEIVED" Mission received
8 "GAME LOADED" Island loaded, vehicles received
9 "BRIEFING SHOWN" Briefing was displayed
10 "BRIEFING READ" Ready to play mission
11 "GAME FINISHED" Game was finished
12 "DEBRIEFING READ" Debriefing read, ready to continue with next mission
Groups:
Multiplayer

Syntax

Syntax:
getClientState
Return Value:
String - client state (see table above)

Examples

Example 1:
_state = getClientState;
Example 2:
if (getClientState == "BRIEFING READ") then { hint "Let the show begin!" };

Additional Information

See also:
getClientStateNumber getPlayerUID

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