Thanks bedges.
Well you hit the nail, it is as simply as that.................but............I dont have controle of the spawning script. Its an extra addon used by those who have it to create whatever they want. The scripts for this are only accassible by them (local computer) and the addon runs on the server aswell. Not all clients need to have it.
I am just another client trying to make a mission with a script running in the background to prevent them from spawning stuff.
Asking them to edit their script just so everytime they spawn a crate (or whatever) they add 1 to the global variable is a nono since they like the fact they have so much spawnpowers
........and I think they demolish the original idea of certain missions
That is why I try to make my script to be able to "see" created stuff. I got all creations covered (units/vehicles/land/air/water) except for ammocrates.
Also I was thinking, one they see I prevent ammocrates spwaning they might spawn empty ammo trucks with new ammo in them. Thats why I tried to count all available ammo in a mission which is carried by the all units and inside ammocrates and vehicles. Is that possible? I can get ammocount out of units, but still not out of crates and ammotrucks.
I hope I make sense here.........otherwise I will just give up on this and allow crates to be spawned