Initial commit
This commit is contained in:
46
Torque/SDK/example/common/server/commands.cs
Normal file
46
Torque/SDK/example/common/server/commands.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Misc. server commands avialable to clients
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function serverCmdSAD( %client, %password )
|
||||
{
|
||||
if( %password !$= "" && %password $= $Pref::Server::AdminPassword)
|
||||
{
|
||||
%client.isAdmin = true;
|
||||
%client.isSuperAdmin = true;
|
||||
%name = getTaggedString( %client.name );
|
||||
MessageAll( 'MsgAdminForce', "\c2" @ %name @ " has become Admin by force.", %client );
|
||||
}
|
||||
}
|
||||
|
||||
function serverCmdSADSetPassword(%client, %password)
|
||||
{
|
||||
if(%client.isSuperAdmin)
|
||||
$Pref::Server::AdminPassword = %password;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Server chat message handlers
|
||||
|
||||
function serverCmdTeamMessageSent(%client, %text)
|
||||
{
|
||||
if(strlen(%text) >= $Pref::Server::MaxChatLen)
|
||||
%text = getSubStr(%text, 0, $Pref::Server::MaxChatLen);
|
||||
chatMessageTeam(%client, %client.team, '\c3%1: %2', %client.name, %text);
|
||||
}
|
||||
|
||||
function serverCmdMessageSent(%client, %text)
|
||||
{
|
||||
if(strlen(%text) >= $Pref::Server::MaxChatLen)
|
||||
%text = getSubStr(%text, 0, $Pref::Server::MaxChatLen);
|
||||
chatMessageAll(%client, '\c4%1: %2', %client.name, %text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user