Page 1 of 2

Disable munitions pickup on a certain condition

Posted: Mon Mar 28, 2005 6:20 pm
by Deutsche Dogge
Ok guys, here's some scripting i did for my map, it works for a part of it, now the other part i need some advice, as i can't find what i look for when i search the forums.

my map contains a munitions depot. at map start, the depot is neutral and nobody can pickup ammo, then teams can switch it to their side to allow ammo pickup.

Here's the part for the switches

Code: Select all


/////////////////////////////////////////
// Switch Ammo Depot to Axis on use
/////////////////////////////////////////
RedAmmoThread:

	while(1)
	{
		$trigger_ammoaxis waittill trigger	// wait until a player activates

		$trigger_ammoaxis nottriggerable	// make sure nothing else gets
		$trigger_ammoallies nottriggerable	// started on either side

		local.player = parm.other		// get player reference

		if(local.player.dmteam == "axis")	// is it an axis? (red)
		{
			// if already controlled, print reminder message
			if(level.ammo_ownerteam == "axis")
			{
				local.player iprint "Your team already has control of the depot!"
			}
			else	// else team gains control
			{
				$trigger_ammoaxis playsound alarm_switch
				level.ammo_ownerteam = "axis"
				iprintlnbold "Red Team gained control of the the munitions depot!"
			}
		}
		else	//player is an allied, print denied message
		{
			local.player iprint "This is the Red Team switch, you cannot activate it!"
			if(level.ammo_ownerteam == "allies")
			{
				// and tell him he already has control
				local.player iprint "Anyway your team already has control of the depot..."
			}
		}

		// reset triggering switches
		$trigger_ammoallies triggerable
		$trigger_ammoaxis triggerable
	}
end

/////////////////////////////////////////
// Switch Ammo Depot to Allies on use
/////////////////////////////////////////
BlueAmmoThread:

	while(1)
	{
		$trigger_ammoallies waittill trigger	// wait until a player activates

		$trigger_ammoallies nottriggerable	// make sure nothing else gets
		$trigger_ammoaxis nottriggerable	// started on either side

		local.player = parm.other		// get player reference

		if(local.player.dmteam == "allies")	// is it an allied? (blue)
		{
			// if already controlled, print reminder message
			if(level.ammo_ownerteam == "allies")
			{
				local.player iprint "Your team already has control of the depot!"
			}
			else	// else team gains control
			{
				$trigger_ammoallies playsound alarm_switch
				level.ammo_ownerteam = "allies"
				iprintlnbold "Blue Team gained control over the munitions depot!"
			}
		}
		else	//player is an axis, print denied message
		{
			local.player iprint "This is the Blue Team switch. You cannot activate it."
			if(level.ammo_ownerteam == "axis")
			{
				// and tell him he already has control
				local.player iprint "Anyway your team already has control of the depot..."
			}
		}

		// reset triggering switches
		$trigger_ammoaxis triggerable
		$trigger_ammoallies triggerable
	}
end
This works #1.

The part i need advice on is, i want to set many kind of munitions to be picked up, the model disappears after being picked up but respawn after a while (i can manage to get this working). Usually, ammo is automatically picked up by the player who touches it, i want to check the dmteam of the player first to see if he's allowed to pick it up.

so far i got this part of the script, the $trigger_ammopickup should be the one activated by the player when picking up the munitions, but i'm not sure it's the good way to go, is there an easier way? can i have control over the automatic pickup of munitions that's ingame?

Code: Select all

////////////////////////////////////////
// Filter who tries to pickup ammo
// level.ammo_ownerteam determine who can pickup
//  axis, allies, neutral(none)
///////////////////////////////////////
AmmoPickupFilter:

	while(1)
	{
		//set waiting trigger on ammo trigger objects
		$trigger_ammopickup waittill trigger  <-- replace this by the ammo models and add a trigger on them?
		local.player = parm.other

		if(level.ammo_ownerteam == "neutral")
		{
			local.player iprintln "Your team must first get control over the munitions depot!"
		}
		else if(local.player.dmteam == level.ammo_ownerteam)
		{
			local.player iprintln "Here is your munitions refill!"
			//give ammo to player, his team owns the depot <-- that's what i need control on, player has good team, give him ammo he touched
		}
		else
		{
			local.player iprintln "Munitions pickup denied"
			local.player iprintln "Your team must first get control over the munitions depot!" <-- that's what im not sure how to
		}
	}
end
Anybody understands what i mean and wanna do? :D

Posted: Mon Mar 28, 2005 10:04 pm
by Deutsche Dogge
I think i got an idea to resolve this finally.

I'll make my own models, spawn some under different trigger brushes and allow the ammo pickup based on my criteria. I think it'll do the job.

Anyway, feel free to let me know if you find another way around this using existing ammo models. :)

Posted: Tue Mar 29, 2005 10:53 pm
by Bjarne BZR
You could use a script_model, set its model to some ammunition, and ghen let your threads give the ammo. That way the model is not giving the ammo and will not disappear. (unless you tell it to in your script)

Posted: Wed Mar 30, 2005 4:09 am
by Deutsche Dogge
Well, i decided to try your suggestion Bjarne's, so far models are spawned ok but i cannot interact with them.

Code: Select all

///////////////////////////////////////////////////////////
// Spawn the ammo depot models and set their values
///////////////////////////////////////////////////////////
SpawnAmmoDepotModels:
	/*
	GUN AMMO ORIGINS
		882.00 728.00 52.00
		882.00 704.00 52.00
		882.00 680.00 52.00
		882.00 656.00 52.00
		882.00 632.00 52.00
		882.00 608.00 52.00
		882.00 584.00 52.00
		882.00 560.00 52.00
		882.00 536.00 52.00
		882.00 512.00 52.00
	GRENADE AMMO ORIGINS
		882.00 452.00 52.00
		882.00 428.00 52.00
		882.00 404.00 52.00
		882.00 380.00 52.00
		882.00 356.00 52.00
	*/
	local.origin = (882.00 356.00 52.00)

	for(local.i = 1; local.i <= 15; local.i++)
	{
		local.ammomodel = spawn script_model //"targetname" "filteredammo" <-- targetname set later in script

		if(local.i <= 5)	// first 5 = paint grenades
		{
			// TODO: change model to custom grenade model
			local.ammomodel model "models/static/50cal_crate.tik"
		}
		else			//last 10 = pbguns ammo
		{
			// TODO: change model to custom ammo pod model
			local.ammomodel model "models/static/50cal_crate.tik"
		}
		local.ammomodel.targetname	= "filteredammo"	// targetname (to use with indexer)
		local.ammomodel.origin		= local.origin		// set model origin
		local.ammomodel.scale		= 1.0			// set model scale
		//local.ammomodel setsize (10 10 10) (-10 -10 -10)	// set trigger size? <-- NOT WORKING, BAD TOKEN -		local.ammomodel setthread AmmoPickupFilter		// set trigger thread <-- NOT WORKING ?

		// increment the origin vector.y position for next model
		local.origin += (0.00 24.00 0.00)

		// if at the first gun ammo, increment more
		if(local.i == 5)
		{
			local.origin += (0.00 60.00 0.00)
		}
	}

end

////////////////////////////////////////
// Filter who tries to pickup ammo
// level.ammo_ownerteam determine who can pickup
//  axis, allies, neutral(none)
///////////////////////////////////////
AmmoPickupFilter:
	println "DEBUG: AmmoPickupFilter thread started"

	local.player = parm.other

	// How to get local.index set from trigerring?
	//local.usedtrigger = $filteredammo[local.index]

	if(local.player.dmteam == level.ammo_ownerteam)
	{
		// give ammo depending on which trigger it is from the index
		//local.player ammo mg 50
		println "DEBUG: give ammo to player"
	}
	else
	{
		local.player iprintln "Your team must control the depot to pickup munitions!"
		local.player iprintln "Have a look around, the switch is close..."
	}

	println "DEBUG: AmmoPickupFilter thread ended"
end
A few questions:

How do i setup the triggers as setthread and setsize don't work. Do i have to spawn a trigger for each model and put the targetname to it instead of putting it to my model?

Shouldn't my script_models spawned be triggerable since they inherits from ScriptSlave -> Mover -> Trigger ?

How can i get a trigger's index to use with $filteredammo[index] when the player trigger's it so i can tell if it's gun or grenade ammo and then do whatever i want with this script_model ?

I know using multiple separated threads can allow me to manage each ammobox separately and makes it easy but not reusable elsewhere and it's not an approach i'd like to use.

EDITED:
Found an answer to this on TMT
http://www.modtheater.com/forum/thread17966.html
:D

Posted: Wed Mar 30, 2005 5:46 am
by Rookie One.pl
I don't know if this is going to be of any use for you, but... ;)

Ammo entities are derived from triggers, right? This means you can do a waittill trigger and execute the triggerable and nottriggerable commands on them.

Posted: Wed Mar 30, 2005 6:29 am
by Bjarne BZR
Deutsche Dogge wrote:EDITED:
Found an answer to this on TMT
http://www.modtheater.com/forum/thread17966.html
:D
Was that an aswer to your all your problems? Or is this thread still active?

Posted: Wed Mar 30, 2005 11:56 pm
by Deutsche Dogge
Bjarne BZR wrote:
Deutsche Dogge wrote:EDITED:
Found an answer to this on TMT
http://www.modtheater.com/forum/thread17966.html
:D
Was that an aswer to your all your problems? Or is this thread still active?
The thread is not active, but the information bdbodger has put in it about trigger arrays using only 1 thread and how to know the index of which trigger was activated. I've been disturbed all day so i couldn't work on it today, but i got the code working last night, models didn't show up though, but triggers works. All i need now is to make the trigger get disabled, hide the model, etc, but that's easy, and show the models.

Gonna post some code later tonight, if i can have some quiet time... damn it. :wink:

Posted: Thu Mar 31, 2005 2:34 am
by Deutsche Dogge
Well, i worked a bit and got alot running, but i still have some problems and questionning.

Code: Select all


///////////////////////////////////////////////////////////
// Spawn the ammo depot models and set their values
///////////////////////////////////////////////////////////
SpawnAmmoDepotModels:
	/*
	GUN AMMO ORIGINS
		882.00 728.00 52.00
		882.00 704.00 52.00
		882.00 680.00 52.00
		882.00 656.00 52.00
		882.00 632.00 52.00
		882.00 608.00 52.00
		882.00 584.00 52.00
		882.00 560.00 52.00
		882.00 536.00 52.00
		882.00 512.00 52.00
	GRENADE AMMO ORIGINS
		882.00 452.00 52.00
		882.00 428.00 52.00
		882.00 404.00 52.00
		882.00 380.00 52.00
		882.00 356.00 52.00
	*/
	local.origin = (882.00 356.00 52.00)

	for(local.i = 1; local.i <= 15; local.i++)
	{
		local.ammomodel 	= spawn script_model "targetname" "filteredammomodel"
		local.ammomodel.origin	= local.origin
		local.ammomodel.scale	= 1.0
		local.ammomodel.index	= local.i

		local.trigmodel 	= spawn trigger_multiple "targetname" "filteredammo"
		local.trigmodel.origin	= local.origin
		local.trigmodel.scale 	= 1.0
		local.trigmodel.index	= local.i

		if(local.i <= 5)
		{
			local.ammomodel model "models/static/50cal_crate.tik"
			//local.ammomodel sound "m2frag_snd_pickup_ammo"
			local.trigmodel sound "m2frag_snd_pickup_ammo"
		}
		else
		{
			local.ammomodel model "models/static/50cal_crate.tik"
			//local.ammomodel sound "m1_snd_pickup_ammo"
			local.trigmodel sound "m1_snd_pickup_ammo"
		}

		//local.ammomodel setsize ( -10 -5 -10 ) ( 10 5 10 )
		//local.ammomodel setthread AmmoPickupFilter
		local.ammomodel show
		local.trigmodel setsize ( -10 -5 -10 ) ( 10 5 10 )
		local.trigmodel setthread AmmoPickupFilter
		//local.trigmodel wait 30


		local.origin += (0.00 24.00 0.00)			// increment the origin vector.y position for next model
		if(local.i == 5) { local.origin += (0.00 60.00 0.00) }	// if at the first gun ammo, increment more
	}

end

////////////////////////////////////////
// Filter who tries to pickup ammo
// level.ammo_ownerteam determine who can pickup
//  axis, allies, neutral(none)
///////////////////////////////////////
AmmoPickupFilter:
	println "DEBUG: AmmoPickupFilter thread started (" self.index ")"

	local.player 	= parm.other	// player who triggered
	local.index	= self.index	// index of trigger activated in array

	self nottriggerable

	if(local.player.dmteam == level.ammo_ownerteam)
	{
		$filteredammomodel[local.index] hide

		if(local.index <= 5)
		{
			//m2fraggrenade, stielhandgranate
			println "DEBUG give 1 grenade to " local.player
			local.player ammo grenade 1
		}
		else
		{
			// Get ammotype of primary weapon to give
			local.temptargname = "weapon" + randomint 10000
			local.player weaponcommand dual targetname local.temptargname
			println "DEBUG player weapon in (" local.index ") is " $(local.temptargname).weapontype
			println "DEBUG ammo for this in (" local.index ") is " $(local.temptargname).ammotype
			local.temptargname targetname ""

			//local.ammotype = $(local.player).ammotype
			//println "DEBUG ammotype using $(local.player).ammotype is " local.ammotype
			//local.ammotype = local.player.ammotype
			//println "DEBUG ammotype using local.player.ammotype is " local.ammotype
			/*
			switch(local.ammotype)
			{
				case "mg"	//bar, mp44
				break

				case "smg"	//mp40, thompson
				break

				case "heavy"	//bazooka, panzershreck
				break

				case "pistol"	//colt45, p38, silencedpistol
				break

				case "rifle"	//kar98, kar98sniper, m1garand, springfield
				break

				case "shotgun"	//shotgun
				break

				default
				break
			}
			*/
			//println "DEBUG give " local.ammotype " ammo to " local.player
		}

		wait 20
		$filteredammomodel[local.index] show
	}
	else
	{
		local.player iprint "Your team must control the depot to pickup munitions!"
		//local.player iprint "Have a look around, the switch is close..."
		wait 20
	}

	self triggerable

	println "DEBUG: AmmoPickupFilter thread ended (" self.index ")"
end

As you can see, i spawn trigger_multiple and script_model because triggering didn't work with script_model and i couldn't setsize either. The way i did it makes it works right, sure it can be done directly with script_model?

Now for the weapons detection, here's a console log cleaned up
http://pages.globetrotter.net/deutsched ... hreads.txt

If player has no weapon in his hands, the weapon detection code doesn't work. I tried to find revelant infos about this but always ended up with the code i'm using or similar code. There is absolutely no way we can get the primary weapon a player has even when holstered? Possible?
I tried to detect using local.player.ammotype or $(local.player).ammotype, but since ammotype is not a member of the player class, it can't and won't work that way.

That's the only non-working part, when i can get the player primary weapon ammotype, script will be done.

I've read this thread /forum/viewtopic.php?t=8044&highlight=detect+weapon
and jv says there are several ways, i'm curious what they are (except the find it yourself way :lol: )

Posted: Thu Mar 31, 2005 11:26 am
by Rookie One.pl
There are 2 ways that I'm aware of - the weaponcommand and the state files (like what Elgan does in his weapon limiter). The state files thingy would be rather useless as the player can drop his weapon and pick another one up.

I suggest forcing the player to unholster his primary weapon:

Code: Select all

local.player useweaponclass rifle
local.player useweaponclass smg
local.player useweaponclass mg
local.player useweaponclass heavy
And then execute the ammo script. Making the player use a weapon class he does not own does nothing, so unless you give him a few primary weapons by script or the weapon classes in TIKs are changed, this will cause him to raise his primary weapon.

Posted: Thu Mar 31, 2005 4:35 pm
by Deutsche Dogge
Thanks Rookie, now i have 3 options. :D

- useweaponclass (fast & reliable)
- uselast (if none in hand but adds a verification -> extra load to server)
- mike_torso.st

For the useability of the state file, i thought about using the RAISE_WEAPON of mike_torso.st and add a script execution in the entrycommands section which would set a level.value[playernumber] to it's weapon class (ammotype) everytime the player raises his weapon if the value has not changed from last time. Then use this value if the player picks ammo to givet he good type of.

Using uselast, i could check the weapon with the code i'm using, if no weapon in hads, make uselast ....but then... what if the last is a grenade? (damn, this one's burned, can't use this)

Using useweaponclass, well, this one seems easy, but it can be restrictive for custom weapons poeple could add to the mod. So i guess my best bet is the mike_torso thing. Even the weapon detection seems to fail, am i doing something wrong with it? Here's modified code:

Code: Select all

	local.randnum = randomint 9999
	local.player weaponcommand dual targetname ("weap" + local.randnum)
	local.usedweapon = $("weap" + local.randnum)
	println "local.usedweapon.weapontype = " local.usedweapon.weapontype
	println "local.usedweapon.ammotype = " local.usedweapon.ammotype
	println "local.usedweapon.targetname = " local.usedweapon.targetname
	println "local.usedweapon.model = " local.usedweapon.model
and give the following in console:
local.usedweapon.weapontype = NIL
local.usedweapon.ammotype = NIL
local.usedweapon.targetname = weap626
local.usedweapon.model = models/weapons/m1_garand.tik


Why is model accessible, but not the other members?
i tried with all the properties in the tik files under the server section but they all return NIL. I didn't want to hard-code the detection from the model name but if that's the only way to go, i'll use the mike_torso way.

Posted: Thu Mar 31, 2005 6:17 pm
by Rookie One.pl
If you take a look at the game classes reference you'll notice that there are no such properties. Weapontype and ammotype are just methods, meaning you cannot read theim, only set them, moreover, only by the TIKI, doing this via script doesn't work.

If I were you I would give the players all types of ammo as ammo without a weapon able to fire it is useless.

Posted: Fri Apr 01, 2005 12:26 am
by Deutsche Dogge
Ok, i though it could be done. So i guess your suggestion is kind of the best option since it doesn't implies original game files modification that could be overwritten by any other mod modifying those files too.

Thanks. :)

Posted: Fri Apr 01, 2005 6:09 pm
by Deutsche Dogge
Final, full working code, thanks guys! :D

Code: Select all

////////////////////////////////////////////////////
// MAP   : Deutsche Dogge
// SCRIPT: Deutsche Dogge
// MOD   : CO2 by AlterNation
//
// Thanks to 'Bjarne BZR' and 'Rookie One' at .map for their help
////////////////////////////////////////////////////
main:

	setcvar "g_obj_alliedtext1" "CO2 Warehouse"
	setcvar "g_obj_alliedtext2" ""
	setcvar "g_obj_alliedtext3" "Control ammo depot"
	setcvar "g_obj_axistext1" "for your team"
	setcvar "g_obj_axistext2" ""
	setcvar "g_obj_axistext3" "Deutsche Dogge"

	setcvar "g_scoreboardpic" "pb_warehouse_loading"

	level waittill prespawn

	exec global/DMprecache.scr
	level.script = maps/dm/pb_warehouse.scr
	exec global/ambient.scr pb_warehouse

	thread SpawnAmmoDepotModels	// spawn ammo depot models

	level waittill spawn

	if(level.roundbsaed)
	{
		level.dmrespawning = 0 		// 1 or 0
		level.dmroundlimit = 5 		// round time limit in minutes
		level.clockside = kills 	// set to axis, allies, kills, or draw
	}

	level.ammo_ownerteam = "neutral"		//axis, allies, neutral
	level.cgametype = int(getcvar(g_gametype))	// current gametype

	//disable triggers in FFA, activate them in other gametypes
	if(level.cgametype == 1)
	{
		$trigger_ammoaxis nottriggerable
		$trigger_ammoallies nottriggerable
	}
	else
	{
		thread RedAmmoThread	// axis ammo switch thread
		thread BlueAmmoThread	// allies ammo switch thread
	}

	if(level.roundbased)
	{
		level waittill roundstart
	}
end

///////////////////////////////////////////////////////////
// Spawn the ammo depot models and set their values
///////////////////////////////////////////////////////////
SpawnAmmoDepotModels:

	local.origin = (882.00 342.00 52.00)	//position of first spawned munition

	for(local.i = 1; local.i <= 15; local.i++)
	{
		local.ammomodel 	= spawn script_model "targetname" "filteredammomodel"
		local.ammomodel.origin	= local.origin
		local.ammomodel.angles	= ( 0 ((randomint 359)+1) 0 )
		local.ammomodel.scale	= 1.0
		local.ammomodel.index	= local.i

		local.trigmodel 	= spawn trigger_multiple "targetname" "filteredammo"
		local.trigmodel.origin	= local.origin
		local.trigmodel.scale 	= 1.0
		local.trigmodel.index	= local.i

		if(local.i <= 5)
		{	//TODO: Change for custom paintball grande model
			local.ammomodel model "models/static/50cal_crate.tik"
		}
		else
		{
			local.ammomodel model "models/paintclip.tik"
		}

		local.ammomodel notsolid
		local.ammomodel show
		local.trigmodel setsize ( -10 -5 -5 ) ( 5 5 5 )
		local.trigmodel setthread AmmoPickupFilter

		local.origin += (0.00 28.00 0.00)			// increment the origin vector.y position for next model
		if(local.i == 5) { local.origin += (0.00 12.00 0.00) }	// if at the first gun ammo, increment more
	}

end

////////////////////////////////////////
// Filter who tries to pickup ammo
// level.ammo_ownerteam determine who can pickup
//  axis, allies, freeforall
///////////////////////////////////////
AmmoPickupFilter:

	local.player 	= parm.other	// player who triggered
	local.index	= self.index	// index of trigger activated in array

	self nottriggerable

	// if player is on owner team or if it's freeforall, give ammo
	if((local.player.dmteam == level.ammo_ownerteam) || level.cgametype == 1)
	{
		$filteredammomodel[local.index] hide

		if(local.index <= 5)
		{
			//give a grenade
			$filteredammo[local.index] playsound "m2frag_snd_pickup_ammo"
			local.player ammo grenade 1
		}
		else
		{
			// give all ammotypes to player, ammo is useless if
			// he has not the needed weapon.
			// solves eventual problems of compatibility with other mods
			$filteredammo[local.index] playsound "m1_snd_pickup_ammo"
			local.player ammo mg 		25
			local.player ammo smg 		25
			local.player ammo heavy 	5
			local.player ammo pistol 	25
			local.player ammo rifle 	25
			local.player ammo shotgun 	25
			waitframe
		}

		for(local.waiting = 0; local.waiting < 15; local.waiting++)
		{
			if((level.ammo_ownerteam != local.player.dmteam) && (level.cgametype != 1))
			{
				waitframe
				break
			}
			else
			{
				wait 1
			}
		}
		$filteredammomodel[local.index] show
	}
	else
	{
		local.player iprint "Your team must control the depot to pickup munitions!" 1
		for(local.waiting = 0; local.waiting < 15; local.waiting++)
		{
			if(level.ammo_ownerteam == local.player.dmteam)
			{
				waitframe
				break
			}
			else
			{
				wait 1
			}
		}
	}

	self triggerable
end

/////////////////////////////////////////
// Switch Ammo Depot to Axis on use
/////////////////////////////////////////
RedAmmoThread:

	while(1)
	{
		$trigger_ammoaxis waittill trigger	// wait until a player activates

		$trigger_ammoaxis nottriggerable	// make sure nothing else gets
		$trigger_ammoallies nottriggerable	// started on either side

		local.player = parm.other		// get player reference

		if(local.player.dmteam == "axis")	// is it an axis? (red)
		{
			// if already controlled, print reminder message
			if(level.ammo_ownerteam == "axis")
			{
				local.player iprint "Your team already has control of the depot!" 1
			}
			else	// else team gains control
			{
				$trigger_ammoaxis playsound alarm_switch
				level.ammo_ownerteam = "axis"
				iprintlnbold_noloc "Red Team gained control of the the munitions depot!"
			}
		}
		else	//player is an allied, print denied message
		{
			local.player iprint "This is the Red Team switch, you cannot activate it!" 1
			if(level.ammo_ownerteam == "allies")
			{
				// and tell him he already has control
				wait 1.5
				local.player iprint "Anyway your team already has control of the depot..." 1
			}
		}

		// reset triggering switches
		$trigger_ammoallies triggerable
		$trigger_ammoaxis triggerable
	}
end

/////////////////////////////////////////
// Switch Ammo Depot to Allies on use
/////////////////////////////////////////
BlueAmmoThread:

	while(1)
	{
		$trigger_ammoallies waittill trigger	// wait until a player activates

		$trigger_ammoallies nottriggerable	// make sure nothing else gets
		$trigger_ammoaxis nottriggerable	// started on either side

		local.player = parm.other		// get player reference

		if(local.player.dmteam == "allies")	// is it an allied? (blue)
		{
			// if already controlled, print reminder message
			if(level.ammo_ownerteam == "allies")
			{
				local.player iprint "Your team already has control of the depot!" 1
			}
			else	// else team gains control
			{
				$trigger_ammoallies playsound alarm_switch
				level.ammo_ownerteam = "allies"
				iprintlnbold_noloc "Blue Team gained control over the munitions depot!"
			}
		}
		else	//player is an axis, print denied message
		{
			local.player iprint "This is the Blue Team switch. You cannot activate it." 1
			if(level.ammo_ownerteam == "axis")
			{
				// and tell him he already has control
				wait 1.5
				local.player iprint "Anyway your team already has control of the depot..." 1
			}
		}

		// reset triggering switches
		$trigger_ammoaxis triggerable
		$trigger_ammoallies triggerable
	}
end


Posted: Sat Apr 02, 2005 10:07 am
by Rookie One.pl
Lol! Thanks for mentioning me! :P

Posted: Sat Apr 02, 2005 1:34 pm
by Deutsche Dogge
Well:
- you helped
- it costs me nothing
- people knows quickly who is susceptible to be helpfull in different cases, depending on what the script does.

:wink: