ID:147180
 
mob/verb/Select_Draftee(mob/M as mob in draftees)
if(draft_round == 1&&draft_pick==1)
for(var/obj/Round1_Pick1/A in usr.contents)
if(A)
usr.Football_Team+=M //invalid expression *error*
usr.userdraft = 0
view()<<"[usr], owner of the [fb_teamname] has drafted [M]!"



This verb is used to select a draftee in my professional sports draft.

What im trying to do is when you attempt to draft a mob, it will check for the item, if no item, no draft; if you have the item it gets erased and it also checks everyone elses inventory for the same item. Can anyone help me out here?
Use locate, its a whole lot nicer.

if(locate((/obj/Round1_Pick1) in usr.contents))
ZLegend wrote:
mob/verb/Select_Draftee(mob/M as mob in draftees)
if(draft_round == 1&&draft_pick==1)
for(var/obj/Round1_Pick1/A in usr.contents)
if(A)
del(A)
for(var/mob/N in world)
for(var/obj/Round1_Pick1/B in N.contents)
del(B)
usr.Football_Team+=M
usr.userdraft = 0
view() << "[usr], owner of the [fb_teamname] has drafted [M]!"
else
return


You really have to explain what the code does in more detail and describe what the variables do. I've helped you from what you've said so far but its unclear.

And this belongs in the newbie central i think.