Bridget
03-07-2010, 02:48 AM
I have a collection which I will store players names in as the game progresses. I have two spawns for each team. One spawn is a regular spawn and the other is a special spawn. They work so that if you're in the collection, you spawn in the special spawn. If you're not in the collection, you default to the regular spawn. Here's the code:
acollection = Collection()
regularspawn = info_ff_teamspawn:New({})
specialspawn = info_ff_teamspawn:New({})
function regularspawn:validspawn(spawn, player)
if(acollection:HasItem(player)) then
return false
end
return true
end
function specialspawn:validspawn(spawn, player)
if(acollection:HasItem(player)) then
return true
end
return false
end
Now, there's a problem with that. Whenever I join my map, it will automatically drop me at a random spawn. Sometimes it drops me at spawns that are named regularspawn and sometimes it drops me at specialspawns, despite not being in the collection. It seems to completely ignore the code. I can pepper the functions with ConsoleToAll('...') for debugging, but every spawn, I don't get any message in my console. Any clue why? Am I typing something incorrectly? I am legitimately stumped. :|
acollection = Collection()
regularspawn = info_ff_teamspawn:New({})
specialspawn = info_ff_teamspawn:New({})
function regularspawn:validspawn(spawn, player)
if(acollection:HasItem(player)) then
return false
end
return true
end
function specialspawn:validspawn(spawn, player)
if(acollection:HasItem(player)) then
return true
end
return false
end
Now, there's a problem with that. Whenever I join my map, it will automatically drop me at a random spawn. Sometimes it drops me at spawns that are named regularspawn and sometimes it drops me at specialspawns, despite not being in the collection. It seems to completely ignore the code. I can pepper the functions with ConsoleToAll('...') for debugging, but every spawn, I don't get any message in my console. Any clue why? Am I typing something incorrectly? I am legitimately stumped. :|