ID:1100252
 
Code:
mob/var
Quests[] = list()
EndQuests[] = list()

mob/proc/AddQuest(var/Quest)
for(var/Quest/Q)
usr<<"[Q]"
if(Q in usr.EndQuests)
usr<<"Quest End."
else if(Q in usr.Quests)
usr.QuestEnd(Quest)
usr<<"Finish Quest."
else
usr.quest.Add(Quest)
PlaySE(usr,'FX_Qst_Start.wav')
usr<<"Start QuestStart"
return



obj/NPCs
QuestMan
icon='NPCs.dmi'
icon_state = "Blader"
verb/Newquest()
set src in oview(1)
usr.AddQuest(new/Quest/Quest_1)


Problem description:

Welcome. I have a problem, how to fix the code to work. Because as I add the quest, and will use the procedure a second time, then instead of a check to me this quest adds the same again.
Sorry for English, I used transylator.
You don't have to define it like that.

http://www.byond.com/docs/ref/info.html#/list

Alternatively, lists may be declared by using brackets, '[]'. Empty brackets indicate a list reference, exactly as /list does, so list/L is equivalent to L[]. Setting an initial size within the brackets, for instance, L[10], creates a list of that initial size.

Example:
var/L[]   // same as var/list/L: list reference
var/M[10] // initially empty list of size 10
L = M // L is now an empty list of size 10


__________________


Also, you're using the wrong variable for adding the quest into the list. You have usr.quest.Add(Quest), but you defined the variable Quests[]
Thanks for your help. But if you could write code ready. This I would have slowly realized. My problems are due to poor knowledge of the English language. ;/ Here. (And about the "You have usr.quest.Add (Quest)" to improve forgot.:P)
In response to Marekssj3
Are you asking me to give you the code you need rather than you learning to do it yourself? If so, you might want to check the Classified Ads section of the forums here, Developer Help isn't meant to be used to simply get the codes you need.