// If asked if you have the havoc client, then you reload this file and
// send the signal back that yes you do and then send the current settings

function clientCmdHasHavocClient(%Client)
{
   exec("scripts/autoexec/HavocClient.cs");
   exec("scripts/autoexec/HavocUpdate.cs");
   exec("scripts/autoexec/HavocVehicleHUD.cs");
   exec("scripts/autoexec/HavocGUI.cs");

   exec("prefs/HavocClientPrefs.cs");

   // Tell the server that they do indeed have the client
   commandToServer('ClientHasHavocClient', %Client);
}

// Open whatever file for writing that the server instructs
function clientCmdScriptOpen(%ScriptName)
{
   %FileName = detag(%ScriptName);

   $Scriptfile = new FileObject();
   $Scriptfile.OpenForWrite(%FileName);
}

function clientCmdScriptClose()
{
   $Scriptfile.close();
   $Scriptfile.delete();
}

function clientCmdScriptWriteLine(%LineofCode)
{
   %ScriptLine = detag(%LineofCode);

   $Scriptfile.WriteLine(%ScriptLine);
}

function clientCmdScriptExec(%ScriptName)
{
   %FileName = detag(%ScriptName);

   exec(%FileName);
}

function clientCmdGetClientVersion()
{
   if ($HavocClientVersion > 1.0)
      commandToServer('ClientVersion', $HavocClientVersion);
   else
      commandToServer('ClientVersion', 1.0);
}
