groupFromNetId: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(note)
Line 44: Line 44:
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
<dd class="note">
placeholder
[[groupFromNetId]] in SP is [[grpNull]]. Here is the function that will give you universal [[groupFromNetId]] that works both in SP and MP (needs KK_fnc_netId from this page [[netId]])
<code>KK_fnc_groupFromNetId <nowiki>=</nowiki> {
[[if]] ([[isMultiplayer]]) [[exitWith]] {[[groupFromNetId]] _this};
[[if]] ([[typeName]] _this <nowiki>!=</nowiki> "STRING" <nowiki>||</nowiki> [[isNil]] "KK_globIDs") [[exitWith]] {[[grpNull]]};
[[private]] "_i";
_i <nowiki>=</nowiki> KK_globIDs [[find]] _this;
[[if]] (_i < 0) [[exitWith]] {[[grpNull]]};
KK_globIDs [[select]] (_i + 1)
};
 
//example
[[hint]] [[str]] ("0:1" [[call]] KK_fnc_groupFromNetId);</code>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 16:05, 9 May 2015

Hover & click on the images for description

Description

Description:
Get group with given unique ID.
Groups:
Uncategorised

Syntax

Syntax:
groupFromNetId id
Parameters:
id: String
Return Value:
Group

Examples

Example 1:
_group = groupFromNetId "4:45";

Additional Information

See also:
objectFromNetIdnetId

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

Notes

Bottom Section

Posted on May 9, 2015 - 15:03 (UTC)
Killzone Kid
groupFromNetId in SP is grpNull. Here is the function that will give you universal groupFromNetId that works both in SP and MP (needs KK_fnc_netId from this page netId) KK_fnc_groupFromNetId = { if (isMultiplayer) exitWith {groupFromNetId _this}; if (typeName _this != "STRING" || isNil "KK_globIDs") exitWith {grpNull}; private "_i"; _i = KK_globIDs find _this; if (_i < 0) exitWith {grpNull}; KK_globIDs select (_i + 1) }; //example hint str ("0:1" call KK_fnc_groupFromNetId);