PlayerGroup, like client group but for players.
This wont work, nothing happens, and on use, it crashes.
if(!isObject(PlayerGroup))
new ScriptGroup(PlayerGroup);
package PlayerGroup_Beta
{
function GameConnection::createPlayer(%client)
{
parent::createPlayer(%client);
PlayerGroup.add(%client.player);
}
function PLayer::playThread(%this,%slot,%thread)
{
parent::playThread(%this,%slot,%thread);
if(%thread $= "Death")
PlayerGroup.remove(%this);
}
function Player::delete(%this)
{
for(%i=0;%i<PlayerGroup.getCount();%i++)
{
if(PlayerGroup.getObject(%i) $= %this && PlayerGroup.getState() !$= "Dead")
PlayerGroup.remove(%this);
}
parent::delete(%this);
}
};activatepackage(PlayerGroup_Beta);