Runar's TV_Presto.cs

CoJack
08-24-2004, 12:24 AM
////////////////////////////////////////////////////////////
// File: TV_Presto.cs
// Version: 1.0
// Author: Runar
// Credits: KineticPoet for Presto-port. Freaky, Gold for beta-tests.
// Info: Observe your flag-carrier in fullscreen with
// a keypress. Do NOT use the built in camera
// with this script.
//
// V. 1.1: Huge re-write..
//
////////////////////////////////////////////////////////////

editActionmap("playmap.sae");
bindCommand(keyboard0, make, "w", TO, "TV::Activate();");
bindCommand(keyboard0, break, "w", TO, "TV::DeActivate();");

Event::Attach(eventFlagTa ken, TV::Flag::Taken);

function TV::Activate()
{
// Can't obs if there's no carrier..
if(Client::GetName($TV::F lagCarrier) == "")
{
$TV::Active = "False";
remoteBP(2048, "<JC><F1>No flag-carrier to observe!", 2);
return;
}

// Delete the entire CommandGui
if(isObject("CommandGui"))
renameObject("CommandGui", "_CommandGui");

// Add CMDObserve if it isn't there..
if(!isObject("PlayGui/ObsTV"))
{
addToSet(PlayGui, newObject("ObsTV", FearGui::CMDObserve, 0, 0, 1, 1));
}

// Go to CommandMode
remoteEval(2048, CommandMode);

// Force full bandwidth
RemoteEval(2048, "scom", -1);

// Turn off the cursor
Schedule("CursorOff(mainwindow);", 0.3);

// Enable observer mode
Client::ToggleCmdObserver ("True");

// Observe flag-carrier
Client::cmdObservePlayer( $TV::FlagCarrier);

// Show who we are obsing
remoteBP(2048, "<JC><F1>Observing: <F2>" @ Client::GetName($TV::Flag Carrier), 999);

// Just to make sure..
$TV::Active = "True";
}

function TV::DeActivate()
{
Client::ToggleCmdObserver ("False");

remoteEval(2048, PlayMode);

if($TV::Active)
deleteObject("PlayGui/ObsTV");

renameObject("_CommandGui", "CommandGui");

remoteBP(2048, "", 0.1);

$TV::Active = "False";
}

function TV::Flag::Taken(%flagId, %clientId, %client)
{
%teamId = Client::getTeam(%clientId );
%myId = Client::getTeam(getManage rId());
if(%teamId == %myId)
$TV::FlagCarrier = %clientId;
}






--------------------------------------------------------------
--------------------------------------------------------------
have been using it the last couple days. i really <3 the idea of it...my only concern is when i hit key to activate it...my jets and ski turns off. very distrubing ='[

was wondering if someone.(/me looks @runar)knew how to tweak it to make all 3 functional @same time?

Slitz
08-24-2004, 12:58 AM
was wondering if someone.(/me looks @runar)knew how to tweak it to make all 3 functional @same time?
Quite impossible to do with script. You can only be in control of one gui mode at a time(cmdgui being somewhat of an an exception). Believe me, I've tried everything to get around that and I know Runar has too.