Hey guys, i'm wondering if it's possible to find how many of type of prop there is.
I know how findByModel(string) and findResult(N) works, just wondering if you can find how many props are found.
Hey guys, i'm wondering if it's possible to find how many of type of prop there is.
I know how findByModel(string) and findResult(N) works, just wondering if you can find how many props are found.
Find = findToArray()
Count = Find:count()
So is that basically setting everything found to an array and then counting how many objects are in that array?
Ok thanks, this is a lot simpler than the other option I thought I would have to use.
Last edited by Elmo the Emo Emperor; 07-05-2009 at 02:35 AM.
OK now that i test that it dosn't really work for me
Here's what i've got running
The spawn output is hooked up to a prop spawner.Code:@name Prop spawner @outputs Spawn interval(1000) Model = "models/weapons/w_models/w_stickybomb.mdl" findByModel(Model) Propcount = findToArray():count() if ( Propcount < 6 ) { Spawn = 1 } elseif ( Propcount >= 6 ) { Spawn = 0 }
The problem is it only spawns 1 prop. I'm thinking I might need something to a toggle line.
Can anyone help?
Last edited by Elmo the Emo Emperor; 07-05-2009 at 02:47 AM.
Not sure but I think the prop spawner needs to be "pulsed" in order to spawn more than one prop. Also, it'd probably be better to leave the array in persist by itself and then call the count afterward, just in case you ever use it again.
Code:@persist PropArray:array PropArray = findToArray() Spawn = PropArray:count() < 6 & clk()
is the clk really necassary? The only thing triggering it is the interval.
Ok thanks, i get what your saying but becaus the clk would constantly be 1 if woudn't pulse as the spawner required
But now that i know what the problem is I think I can fix this myself. Thanks mate
Edit: Got it working just added in a very slow run on tick command just to oscillate it (and not to lag the server too much)
Thanks
Last edited by Elmo the Emo Emperor; 07-05-2009 at 03:36 AM. Reason: Finished
Bookmarks