name – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Added example)
m (Text replacement - " (={2,})([^ = ])(.*)([^ = ])(={2,}) * " to " $1 $2$3$4 $5 ")
 
(6 intermediate revisions by 3 users not shown)
Line 3: Line 3:
: Try [[group]] command. It will return group's ID, but also side (e.g. "WEST 1-1-A"). ++[[User:Str|Str]] 00:48, 17 June 2007 (CEST)
: Try [[group]] command. It will return group's ID, but also side (e.g. "WEST 1-1-A"). ++[[User:Str|Str]] 00:48, 17 June 2007 (CEST)


Example:
=== Example ===
[[User:MulleDK13|MulleDK13]] 01:49, 14 July 2010 (CEST)
  hint Format["%1 %2", group player, name player];
  hint Format["%1 %2", group player, name player];
Will display this in a hint:
Will display this in a hint:
  B 1-1-A MulleDK19
  B 1-1-A MulleDK19
it would be great if name would return group id without prefix (B in example above) like (name group player == "1-1-A") --[[User:Messiah2|MessiahUA]] 12:06, 23 June 2011 (CEST)
:Why not use something along these lines? --[[User:Kju|Kju]] 08:15, 24 June 2011 (CEST)
_name = name group player;
_nameArray = toArray _name;
_stringLength = count _nameArray;
_return = "";
_tempArray = [];
for "_i" from (2) to (_stringLength - 1) do
{
  _tempArray set [count _tempArray,_nameArray select _i];
};
_return = toString _tempArray;
_return;
:: name doesn't work for groups unfortunately and currently I use: --[[User:Messiah2|MessiahUA]] 10:40, 24 June 2011 (CEST)
_array = [str group player, " "] call CBA_fnc_split;
_array = [_array,0] call BIS_fnc_removeIndex;
_name = [_array, " "] call CBA_fnc_join;

Latest revision as of 19:17, 31 January 2021

Is there a way to get 1-1-A ?? (part before the name?) --Doolittle 23:36, 16 June 2007 (CEST)

Try group command. It will return group's ID, but also side (e.g. "WEST 1-1-A"). ++Str 00:48, 17 June 2007 (CEST)

Example

MulleDK13 01:49, 14 July 2010 (CEST)

hint Format["%1 %2", group player, name player];

Will display this in a hint:

B 1-1-A MulleDK19

it would be great if name would return group id without prefix (B in example above) like (name group player == "1-1-A") --MessiahUA 12:06, 23 June 2011 (CEST)

Why not use something along these lines? --Kju 08:15, 24 June 2011 (CEST)
_name = name group player;
_nameArray = toArray _name;
_stringLength = count _nameArray;
_return = "";
_tempArray = [];
for "_i" from (2) to (_stringLength - 1) do
{
 _tempArray set [count _tempArray,_nameArray select _i];
};
_return = toString _tempArray;
_return;
name doesn't work for groups unfortunately and currently I use: --MessiahUA 10:40, 24 June 2011 (CEST)
_array = [str group player, " "] call CBA_fnc_split;
_array = [_array,0] call BIS_fnc_removeIndex;
_name = [_array, " "] call CBA_fnc_join;