function ghostplayer(%name) {
//$pref::server::maxplayers++;
$Server::PlayerCount++;
%client = new AIConnection () {};
%client.name = %name;
%client.name = addTaggedString("\cp\c8" @ %name @ "\co");
%client.guid = 0;
%client.isadmin=0;
addToServerGuidList(%client.guid);
//ClientGroup.add(%client);
%client.score=0;
//$gbc++;
$ghostbots[$gbc++]=%client;
messageAllExcept(%client, -1, 'MsgClientJoin', '%1 has connected to the server.',
%client.name,
%client,
%client.sendGuid,
%client.score,
%client.isAiControlled(),
%client.isAdmin,
%client.isSuperAdmin,
%client.isMod);
}
function deleteghostplayers() {
for(%i=-1; %i<=$gbc; %i++) {
//$pref::server::maxplayers--;
$Server::PlayerCount--;
%client=$ghostbots[%i];
messageAllExcept(%client, -1, '', '%1 left the server.', %client.name);
%client.delete();
$gbc--;
}
if($gbc > 0)
messageclient(getlocal(), '', '\c5Not all ghosts were deleted. Count: \c3%1\c5.', $gbc);
}
Old TBM code. Will NOT work in Retail without major overhaul of the code, but general idea is there.