// ========================================
// JumpJet
// ========================================

//  Default On or Off
$Jet::Jump = "True";

// Don't touch this line
editActionmap("playmap.sae");

// * Jump & Jet, jump before you jet.
bindCommand(mouse0, make, button1, TO, "Jet::Start();");
bindCommand(mouse0, break, button1, TO, "Jet::Stop();");

// * Jet & Jump Toggle
bindCommand(keyboard0, make, shift, "space", TO, "Jet::Toggle();");
bindCommand(keyboard0, break, shift, "space", TO, "");

function Jet::Start()
{
	if(getMountedItem(0) != -1 && $Jet::Jump)
	{
		postAction(2048, IDACTION_MOVEUP, 1);
        	postAction(2048, IDACTION_JET, 1);
	}
	else
	{
		postAction(2048, IDACTION_JET, 1);
	}
}

function Jet::Stop()
{
	postAction(2048, IDACTION_JET, 0);
}

function Jet::Toggle()
{
 	$Jet::Jump = !$Jet::Jump;
 
	if($Jet::Jump)
	{
		remoteBP(2048, "<JC><F2>Jet & Jump set to: <F1>ON", 2);
  	} 
	else
	{
  		remoteBP(2048, "<JC><F2>Jet & Jump set to: <F0>OFF", 2);
 	} 
}