function CheckSpawnZones()
for k, vector in pairs(SpawnZone) do
local entity = ents.FindInSphere(vector.Vector,300);
for _, class in pairs(CheckFor) do
local ent = tostring(entity:GetClass());
if (class == ent) then
return;
end
end
end
return true;
end

Edited:

function CreateSpawn(ply,cmd, args)
local trace = ply:GetEyeTrace();
if (trace.HitWorld) && (#args == 2) then
AddSpawnZone(trace.HitPos, args[1], args[2], #SpawnZone + 1);
else
ply:ChatPrint("You must enter two arguments and look at the world!\n I.E. create_spawnpoints 'class' 'true/false'");
end
timer.Create("SpawnZoneThink", 0.5, 0, function()
local RandomX = math.random(-100,100);
local RandomY = math.random(-100,100);
for k, v in pairs(SpawnZone) do
if (CheckSpawnZones() == false) then return end
CreateNPC(v.Class, v.Vector + Vector(RandomX, RandomY, 0))
end
end);
end
concommand.Add("create_spawnpoints", CreateSpawn);
function CreateNPC(class, vector)
local ent = ents.Create(class);
ent:SetPos(vector);
ent:Spawn();
end
function CheckSpawnZones()
for k, vector in pairs(SpawnZone) do
local entity = ents.FindInSphere(vector.Vector,175);
for _, class in pairs(CheckFor) do
for k, v in pairs(entity) do
if v == class then
return true
else
return false
end
end
end
end
end

I solved the first part. How do I make it so it doesn't only spawn when something is isnt in any of the spheres and just the sphere where the spawn is? I can be in one zombies spawn, and others will spawn is what I mean. For now it only spawns in the 2 spawn I create and not in the third or fourth.

Ok, so I have a few issues that are giving me hell, not really sure they can be fixed either but I thought I'd try and get some assistance.

Firstly I am making a map that has a 3D Sky box that you can enter, and then the actual map shows in the middle of the 3D Sky box with everything at 1/64th scale, and when you are in the map and look up you see out of the glass case in the middle of the Sky box and see everything there 64x normal size, there is a teleport that take you between them.

So far I can draw the player, props, vehicles, and some SENTs in miniature but I can't seem to redraw some things like fire and explosion effects, and this is the part I don't think I can do at all.

The part I think I can fix is with my npc's some will scale just fine, but all humanish characters don't scale, i've brought and illustration:First What works
Antlion's scale just fine, this is a normal first person shot.

This shot is from a camera in the sky box room, me and the antlion are in the bottom left to the right of the health display, tiny just as they should be.

This shot is from the camera seen in the lower left of the last shot, this camera is also in the sky box room but it is just beyond the inside wall to get a close up.

and now...
These next 3 are exactly the same but with mossman, she doesn't scale.
First person shot, you can see the full size model being drawn in sky box room.

This is from first sky box cam, again, she is full sized, =(

and last from the close up camera.

Any way here's the code, it's not pretty at the moment and there's shit in there that is only there because i'm trying to fix this, and it's all in one file till I get this working the way I want, then I'll clean it all up.

--doesn't scale
--zombine
--zombie
--fast zombie
--antlion guard
--antlion worker (wings)
--roller mine (effect)
--ragdolls
renderClasses = {
"prop",
"npc",
"player",
"rag",
"env",
"meteor",
"weapon"
}
function IsClass( ent, class )
if ent == nil then return false end
if ent == NULL then return false end
if !ent:IsValid() then return false end
local result = nil
local isClass = false
if type(class) == "table" then
for k,v in pairs(class) do
result = string.find(ent:GetClass(),v)
if !(result == nil) then
isClass = true
end
result = nil
end
else
--print("Is " .. ent:GetClass() .. " a " .. class .. " : " .. tostring(!(result == nil)))
result = string.find(ent:GetClass(), class)
if !(result == nil) then
isClass = true
end
end
return isClass
end
if CLIENT then
tankPos = Vector(0,0,0)
renderEnts = {}
hook.Add("OnEntityCreated", "get_it", function(ent)
if IsClass(ent, "class") then
table.insert(renderEnts, ent:EntIndex())
end
end)
for k,v in pairs(ents.GetAll()) do
if IsClass(ent, "class") then
table.insert(renderEnts, ent:EntIndex())
end
end
function getRenderEnts(msgData)
local newEnt = msgData:ReadShort()
if table.HasValue(renderEnts, newEnt) then return end
table.insert(renderEnts,newEnt)
end
usermessage.Hook("get_render_ents", getRenderEnts)
function getTankPos(msgData)
tankPos = msgData:ReadVector()
print("tankPos: " .. tostring(tankPos))
end
usermessage.Hook("get_tank_pos", getTankPos)
hook.Add("PostDrawOpaqueRenderables", "fuckinA", function()
local scale = 1 / 64
cam.Start3D(EyePos(), EyeAngles())
for k,v in pairs(renderEnts) do
local rendEnt = ents.GetByIndex(v)
if !(rendEnt == NULL) and
!(rendEnt:IsWorld()) then
local curPos = rendEnt:GetPos()
local rendPos = tankPos + (curPos * scale)
--Draw Mini
rendEnt:SetPos(rendPos)
--rendEnt:SetRenderOrigin(rendPos)
rendEnt:SetModelScale(Vector(scale,scale,scale))
if IsClass(rendEnt, "npc") or
IsClass(rendEnt, "rag") then
rendEnt:InvalidateBoneCache()
rendEnt:SetupBones()
end
if rendEnt.DrawModel then
rendEnt:DrawModel()
end
if rendEnt.Draw then
rendEnt:Draw()
end
if rendEnt.DrawTranslucent then
rendEnt:DrawTranslucent()
end
if rendEnt:IsPlayer() and ValidEntity(rendEnt:GetActiveWeapon()) then
rendEnt:GetActiveWeapon():DrawModel()
end
--Draw Normal
rendEnt:SetPos(curPos)
rendEnt:SetModelScale(Vector(1,1,1))
if !IsClass(rendEnt, "npc") then
rendEnt:DrawModel()
end
else
table.remove(renderEnts, k)
end
end
cam.End3D()
return false
end)
end
if SERVER then
local renderEnts = {}
function addRenderEnt(ent)
if !table.HasValue(renderEnts,ent) then
table.insert(renderEnts, ent)
end
umsg.Start("get_render_ents")
umsg.Short(ent:EntIndex())
umsg.End()
end
hook.Add("SetupPlayerVisibility", "fert", function(ply, ent)
AddOriginToPVS(Vector(0,0,0))
for k,v in pairs(renderEnts) do
if ValidEntity(v) then
AddOriginToPVS(v:GetPos())
else
table.remove(renderEnts,k)
end
end
end
)
for k,v in pairs(ents.GetAll()) do
if v:GetName() == "tank_middle" then
umsg.Start("get_tank_pos")
umsg.Vector(v:GetPos())
umsg.End()
end
if !v:IsWorld() then
if v.GetPhysicsObject then
local vPhys = v:GetPhysicsObject()
if vPhys and vPhys.IsValid and vPhys:IsValid() then
addRenderEnt(v)
end
end
end
end
hook.Add("OnEntityCreated", "get_it", function(ent)
timer.Simple(0.01, checkEnt, ent)
end)
function checkEnt(ent)
if ValidEntity(ent) then
if !ent:IsWorld() then
if ent.GetPhysicsObject then
local vPhys = ent:GetPhysicsObject()
if vPhys and vPhys.IsValid and vPhys:IsValid() then
addRenderEnt(ent)
end
else
if IsClass(ent, "env_") then
addRenderEnt(ent)
end
end
end
end
end
hook.Add("PlayerInitalSpawn", "see_it", function(ply)
for k,v in pairs(renderEnts) do
umsg.Start("get_render_ents")
umsg.Short(v:EntIndex())
umsg.End()
end
end)
end

if ply:IsValid() then
for k,v in pairs(Sounds) do
if string.find( text, k ) then
ply:EmitSound(Sounds[k].Destination, 500, 100) -- or v.Destination
return text
end
end
end

Thanks both. I thought I missed something like that.

Edited:

Hm, still isn't emiting the sound.

function SoundPlayer.ChatFunction( ply, text )
if ply:Alive() then
for k,v in pairs(Sounds) do
if string.find( text, k ) then
ply:EmitSound(Sounds[k].Destination, 500, 100) -- or v.Destination
return text
end
end
end
end
hook.Add("PlayerSay", "SoundPlayer.ChatFunction", SoundPlayer.ChatFunction)