var/list/Team1=list()
var/list/Team2=list()
mob/verb/Tell(var/mob/M in Team1||Team2)
if(M.Tell==src.Tell)
var/T = input("Private msg to [M]")as text
src<<"You Tell)[M]:[html_encode(T)]"
M<<"<usr](Tells You):[html_encode(T)]"
Seems like its only checking the first List...I want to be able to pick people in both teams but not other non client mobs in world.Im not really sure what operator i need to use.I have tried many like || && ^ ect thanks in advance
I know i dont want && cause its only true if the person is in both teams right?Which is pointless i dont want || cause it will only checks 1 team or the other right? ugh i dont know what to do
Brokenleg wrote:
I'm not too sure, someone who knows a little more than I do can confirm this, but when you'r trying to search through two lists like that, using a literal "or"(||) operator like that just won't work. And whenever you do do something like that in an if() statement, you have to treat it lke two seperate conditions entirely:
if(M.Tell==src.Tell || M.Tell==5)
That would return true if either or those conditons were true. You couldn't do something like this:
if(M.Tell==src.Tell||5)
So, the way you want to do this is combine the lists for the two teams into one list, then put that list into the verbs parameters, like so:
Now, make sure to delete or at least empty out the Teamcombine list whenever you're done with it in your code, unless of coure you want the list to remain with the same vaule as it originally combines.
Resonating Light