ID:161920
 
is it possible to make things check for items in a list?
lets say if "warrior" is in the list then an option will let u choose it. if its not in there it wont even pop up?
yeah, by using <font size=2><code>Find()</code> proc.


http://www.byond.com/docs/ref/info.html#/list/proc/Find
In response to Scizzees
hmmm
now i'm trying to get it to display the contents of the list in a command. how do i do so. i keep getting /list when it displays to the player.
In response to Rikishi
You can use a <code><font size=2>for()</code></font size> loop.

for(var/C in list)
usr << C
In response to Scizzees
hmm i'm trying to get this npc to list the players jobs that he has gained in his list..then let them be able to change into them depending on if they have it in there list.

                Change_Job()
set src in oview(1)
set name = "Change Job"
set category = "Npc"
for(var/j in jobs)
switch(input("Which job would you like to change to?", "Jobs") in list ("Warrior", "Monk", "Black Mage", "White Mage", "Blue Mage"))
if("Warrior")
if(j.Find("Warrior"))
usr<<"You are now a warrior!"
else
usr<<"You can't be a warrior!"


it doesnt seem to work any ideas?
In response to Rikishi
                    switch(input("Which job would you like to change to?", "Jobs") in jobs)
In response to Garthor
says i need to define j
In response to Rikishi
Forget j. You're overcomplicating this. What exaclty are you trying to accomplish? Have them pick a character class from a specific list?
In response to Chessmaster_19
yes kinda. I want to make it so they getting a starting jobs to pick from then as the game progresses it will add new jobs to there list. then they can switch to those.
In response to Rikishi
nvm i got it