View Single Post
Old 05-29-2008, 01:46 AM   #13
Pon
Not choking. Yet.
Lua Team
Wiki Team
Fortress Forever Staff
 
Pon's Avatar
 
Join Date: Jul 2007
Location: Scotland
Class/Position: Demo/Def - Spy/Off
Gametype: Anything but yet more fucking CTF
Affiliations: FF.AvD [FF AvD/ID guild]
Posts Rated Helpful 0 Times
Ok, on the offchance that this might help someone else finish it off, here's what i was trying to do:

Code:
local c = Collection()

nonades = trigger_ff_script:new({})

function nonades:ontouch( touch_entity )
	if IsPlayer( touch_entity ) then
		local player = CastToPlayer( touch_entity )
		-- Add this player to the collection
		c:AddItem( player )
	end
end


function nonades:onendtouch( touch_entity )
	if IsPlayer( touch_entity ) then
		local player = CastToPlayer( touch_entity )
		-- Remove player from collection
		c:RemoveItem( player )
	end	
end


-- This is fired when everyone has stopped touching "nonades"
-- and it goes to its inactive state
function nonades:oninactive()
	-- Clear out the items in the collection
	c:RemoveAllItems()
end



function player_onthrowgren2(player, prime)

	if c:Count() == 0 then
		return EVENT_ALLOWED
	end

	for temp in c.items do
		local c_player = CastToPlayer( temp )
		
		if c_player == player then
			return EVENT_DISALLOWED
		end
	end

	return EVENT_ALLOWED
end
Didn't work, however using a gren inside the nonades area did produce an error, whereas using it outside of it did not... so it must be on the right track, I think.
__________________
Support FF:

YOU GUYS REALLY SHOULD UPDATE YOUR STAFF LIST!
I haven't posted since 2010...

Preferable to death. But only just...
Pon is offline   Reply With Quote