ID:147184
 
obj/draft_machine
icon = 'objects.dmi'
icon_state = "draftmach"
verb/Use_Draft_Machine()
set src in view(1,usr)
if(usr.fb_teamname == null)
usr << "You cannot participate in the draft because you don't have a team."
if(draft_round == null)
usr << "The draft has not begun yet"
if(draft_round == "[draft_round]" && draft_pick == "[draft_pick]")
if(locate("/obj/Round[draft_round]Pick[draft_pick]")in usr.contents)
usr << "Hello, [usr]! Please select a player from the draft pool."
usr.userdraft = 1


Can someone help me out?
It's a professional sports draft system. I have a proc that rotates to higher draft picks. Ex: Round 1 Pick 1 to Round 1 Pick 2.
You know, "flat out does not work" really doesn't give anyone enough information to go on. What I can tell you though is that the way you're using locate() won't work, because locate(string) always tries to find an object with that string as a tag; it does not convert that string to a type path.

Lummox JR
In response to Lummox JR
if(locate("/obj/Round[draft_round]Pick[draft_pick]")in usr.contents)


That line of coding is the problem.

I want to design it like that so the person with the highest pick (ex: 1st round pick #1) gets the first pick.

I have a proc that goes from round to round and pick to pick every 8 minutes so if that person doesnt pick in 8 minutes, that pick is lost.

Example:

1st Round, Pick 1

8 minutes later... (if pick is not used) 1st Round, Pick 2
In response to ZLegend
ZLegend wrote:
if(locate("/obj/Round[draft_round]Pick[draft_pick]")in usr.contents)
That line of coding is the problem.

Yes, that's exactly what I said. You're using locate() incorrectly. Giving it a string tells it to look for a tag, not a type.

I want to design it like that so the person with the highest pick (ex: 1st round pick #1) gets the first pick.

Then you shouldn't be using type paths for this. They're static, but the information you want to sort is anything but.

Lummox JR