#library "Tomtefar"
#include "zcommon.acs"

bool PistolStuffSpawned;

script 1000 OPEN
{
	PistolStuffSpawned = OFF;
}


// --------------------------------------------------------------------------
//
//	Check weapons
//
// --------------------------------------------------------------------------

Script 1001 (void)//"CheckPistol" (void)
{
	SetResultValue(GetCVar("TE_Pistol"));
}
Script 1002 (void)//"CheckRevolver" (void)
{
	SetResultValue(GetCVar("TE_Revolver"));
}
Script 1003 (void)//"CheckAutoShotgun" (void)
{
	SetResultValue(GetCVar("TE_AutoShotgun"));
}
Script 1004 (void)//"CheckSniper" (void)
{
	SetResultValue(GetCVar("TE_Sniper"));
}
Script 1005 (void)//"CheckRailgun" (void)
{
	SetResultValue(GetCVar("TE_Railgun"));
}
Script 1006 (void)//"CheckC4" (void)
{
	SetResultValue(GetCVar("TE_C4"));
}


Script 1021 (void)//"CheckStartWeapon" (void)
{
	SetResultValue(GetCVar("TE_StartWeapon"));
}


// --------------------------------------------------------------------------
//
//	Keybinds
//
// --------------------------------------------------------------------------

Script 1031 (void) NET//"ThrowC4" (void) NET
{
	if(CheckInventory("C4Weapon"))
	{
		if(CheckInventory("C4Ammo"))
		{
			GiveInventory("GoThrowC4", 1);
			SetWeapon("C4Weapon");
		} else {
			Print(s:"No C-4 Left.");
		}
	} else {
		Print(s:"You don't have a detonator.");
	}
}

Script 1032 (void) NET//"WeapSpecial" (void) NET
{
	GiveInventory("WeapSpecial", 1);
}


// --------------------------------------------------------------------------
//
//	Misc.
//
// --------------------------------------------------------------------------

Script 1041 (void)//"CheckFlashlight" (void)
{
	SetResultValue(GetCVar("TE_Flashlight"));
}

Script 1042 (void)//"PistolStuffSpawned" (void)
{
	if (PistolStuffSpawned == ON)
	{
		SetResultValue(1);
	} else {
		PistolStuffSpawned = ON;
		SetResultValue(0);
	}
}