ID:263762
 
Code:
mob/proc/Getitem(list/item,list/amount)
for(var/s in item)
var/obj/S = new(s)
for(var/i = 0,i<amount.len,i++)
for(var/s2 in amount)
src.Items += S

mob/proc/Delitem(list/reqitem,list/reqamount)
for(var/i = 0,i<reqamount.len,i++)
for(var/obj/m in reqitem)
for(var/m2 in reqamount)
if(isnum(m2)) //make sure the thing in the list are numbers
for(var/s = 0,s<m2,s++) //for the amount the thing in the list says
src.Items -= m


mob/var/list/Rewards //list of objs, rewarded after a quest
mob/var/list/RewardAmount //the quantity of the reward

mob/var/list/Itemrequire //a list of objs required for the reward
mob/var/list/Reqitemamount //the amount of the objs required for the reward

obj/stick
obj/magazine

mob/Blacksmith

Rewards = list(/obj/stick)
RewardAmount = list(10)
Itemrequire = list(/obj/magazine)
Reqitemamount = list(69)

//First of all, I am trying to make a easier way to delete and reward multiple items and quantities
//Im gonna use this in ITEM GATHERING quests.
//I looked through a bunch of the things and found the FOR LOOP, which i dont really use much
//So here, im using the for proc to find the item and amount stuff, and yeah
//Uhh so yeah i need help because i think i am using the for proc wrong because im using it a bunch of times
//This code inspired by Eathena Ragnarok Quest Scripts
/*
Ex:

you give a quest mob the lists

Rewards = list("/obj/stick","/obj/monkey") //a stick and a monkey will be given as an a reward

RewardAmount = list("10","2") //10 sticks and 2 monkeys will be rewarded

Itemrequire = list("/obj/iron","/obj/cobalt","/obj/nickle") //since this is an item gathering quest system
//you need the items, here i put iron, cobalt, and nickle

Reqitemamount = list("25","14","23") //items required to recieve the reward are 25 iron,14 cobalt, and 23 nickle

I use

Getitem() to receive the rewards
Delitem() to delete the items required for the quest

the problem is, i dont kno how to use FOR LOOPS to make this possible
*/


Problem description:

The problem is, IM trying to make 2 procs, one that will delete teh items needed for a quest, and another to reward the person according to quest the problem is i dont kno how to use For procs to make this possible, please help
You're... not coding very well. You're using lists improperly and pointlessly, among other things. I recommend reading the helpful resources found here as well as on the left of this page, and then re-writing your code.