Skip to content

Instantly share code, notes, and snippets.

@Azaezel
Created March 18, 2019 10:47
Show Gist options
  • Save Azaezel/33b898496e505ee51ed8e5ed5ecba27e to your computer and use it in GitHub Desktop.
Save Azaezel/33b898496e505ee51ed8e5ed5ecba27e to your computer and use it in GitHub Desktop.
function pushPlayerIDS()
{
if(isObject(ClientGroup))
{
%clientCount = ClientGroup.getCount();
for (%clientIndexA = 0; %clientIndexA < %clientCount; %clientIndexA++)
{
%clientA = ClientGroup.getObject(%clientIndexA);
%teamMateCount = 0;
for (%clientIndexB = 0; %clientIndexB < %clientCount; %clientIndexB++)
{
if ((%clientIndexA != %clientIndexB)&&(isObject(%clientA.player)))
{
//find the other clients players
%clientB = ClientGroup.getObject(%clientIndexB);
%obj = %clientB.player;
if (isObject(%obj))
{
//get the ghostIDs of the players for each other
%ghostIndex = %clientA.getGhostID(%obj);
%teamMateCount++;
commandToClient(%clientA,'setHealthBarTracking',%teamMateCount,%ghostIndex,getTaggedString(%clientB.playerName),%clientB.type);
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment