home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / demo / server / scripts / centerPrint.cs < prev    next >
Encoding:
Text File  |  2005-11-23  |  2.4 KB  |  87 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. function centerPrintAll( %message, %time, %lines )
  7. {
  8.    if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
  9.       %lines = 1;
  10.    
  11.    %count = ClientGroup.getCount();
  12.    for (%i = 0; %i < %count; %i++)
  13.     {
  14.         %cl = ClientGroup.getObject(%i);
  15.       if( !%cl.isAIControlled() )
  16.          commandToClient( %cl, 'centerPrint', %message, %time, %lines );
  17.    }
  18. }
  19.  
  20. function bottomPrintAll( %message, %time, %lines )
  21. {
  22.    if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
  23.       %lines = 1;
  24.    
  25.    %count = ClientGroup.getCount();
  26.     for (%i = 0; %i < %count; %i++)
  27.     {
  28.         %cl = ClientGroup.getObject(%i);
  29.       if( !%cl.isAIControlled() )
  30.          commandToClient( %cl, 'bottomPrint', %message, %time, %lines );
  31.    }
  32. }
  33.  
  34. //-------------------------------------------------------------------------------------------------------
  35.  
  36. function centerPrint( %client, %message, %time, %lines )
  37. {
  38.    if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
  39.       %lines = 1;
  40.       
  41.    
  42.    commandToClient( %client, 'CenterPrint', %message, %time, %lines );
  43. }
  44.  
  45. function bottomPrint( %client, %message, %time, %lines )
  46. {
  47.    if( %lines $= "" || ((%lines > 3) || (%lines < 1)) )
  48.       %lines = 1;
  49.  
  50.    commandToClient( %client, 'BottomPrint', %message, %time, %lines );
  51. }
  52.  
  53. //-------------------------------------------------------------------------------------------------------
  54.  
  55. function clearCenterPrint( %client )
  56. {
  57.    commandToClient( %client, 'ClearCenterPrint');
  58. }
  59.  
  60. function clearBottomPrint( %client )
  61. {
  62.    commandToClient( %client, 'ClearBottomPrint');
  63. }
  64.  
  65. //-------------------------------------------------------------------------------------------------------
  66.  
  67. function clearCenterPrintAll()
  68. {
  69.     %count = ClientGroup.getCount();
  70.     for (%i = 0; %i < %count; %i++)
  71.     {
  72.         %cl = ClientGroup.getObject(%i);
  73.       if( !%cl.isAIControlled() )
  74.          commandToClient( %cl, 'ClearCenterPrint');
  75.    }
  76. }
  77.  
  78. function clearBottomPrintAll()
  79. {
  80.     %count = ClientGroup.getCount();
  81.     for (%i = 0; %i < %count; %i++)
  82.     {
  83.         %cl = ClientGroup.getObject(%i);
  84.       if( !%cl.isAIControlled() )
  85.          commandToClient( %cl, 'ClearBottomPrint');
  86.    }
  87. }