KevinBlast/marble/server/scripts/centerprint.cs

89 lines
2.3 KiB
C#
Raw Normal View History

2024-03-10 20:27:00 -04:00
//-----------------------------------------------------------------------------
// Torque Game Engine
//
// Copyright (c) 2001 GarageGames.Com
// Portions Copyright (c) 2001 by Sierra Online, Inc.
//-----------------------------------------------------------------------------
function centerPrintAll( %message, %time, %lines )
{
if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
%lines = 1;
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if( !%cl.isAIControlled() )
commandToClient( %cl, 'centerPrint', %message, %time, %lines );
}
}
function bottomPrintAll( %message, %time, %lines )
{
if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
%lines = 1;
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if( !%cl.isAIControlled() )
commandToClient( %cl, 'bottomPrint', %message, %time, %lines );
}
}
//-------------------------------------------------------------------------------------------------------
function centerPrint( %client, %message, %time, %lines )
{
if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
%lines = 1;
commandToClient( %client, 'CenterPrint', %message, %time, %lines );
}
function bottomPrint( %client, %message, %time, %lines )
{
if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
%lines = 1;
commandToClient( %client, 'BottomPrint', %message, %time, %lines );
}
//-------------------------------------------------------------------------------------------------------
function clearCenterPrint( %client )
{
commandToClient( %client, 'ClearCenterPrint');
}
function clearBottomPrint( %client )
{
commandToClient( %client, 'ClearBottomPrint');
}
//-------------------------------------------------------------------------------------------------------
function clearCenterPrintAll()
{
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if( !%cl.isAIControlled() )
commandToClient( %cl, 'ClearCenterPrint');
}
}
function clearBottomPrintAll()
{
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if( !%cl.isAIControlled() )
commandToClient( %cl, 'ClearBottomPrint');
}
}