ID:261702
 
I need to know how I would go about making a tag verb. It would be available only to the user who is "it" and would make another player "it". The user of the verb would have to be next to the target mob. Sorry about this. I am a complete n00b.

Also, is it possible to change the person who is "it" when the current "it" logs off without tagging anyone?
Here is my code so far:

tag(mob/M as mob in oview(1))
usr << "You tagged [M]!" oview() << "[usr] tags [M]!" world << "[M] is it!"

As you can see, I need the actual "it" passing code in there. Plus I get this error when I try to run and compile:

tag: duplicate definition (conflicts with built-in proc)

Being the newbie that I am, I don't know what any of the built-in procs are, much less which one my tag verb conflicts with.
In response to Dude-san
I'm not really sure but here goes:
var/it //defin a variable for tha tagger

mob/verb
Tag(mob/M)
set src in oview(1) //the verb only comes if in oview 1
if(M == usr) return //if they are the same then
stop
if(!it) return //no ones it
if(it != usr) return //if it isnt the user then stop
usr << "You tagged [M]" //output msges
M << "[usr] tags you!"
world << "[usr] tags [M]. [M] is now it"
it = M //make M the person who is it
return

Hope that works! lolz
In response to Weedman
Even better:
mob
Bump(atom/A) //When you bump into something...
if(ismob(A)) //If A is a mob. It could be an object or a turf, y'know!
var/mob/M = A //Cast it to a mob, so we're dealing...
//...with mob/M, and thus have access to all of /mob's variables.
if(it) //If you're it. The src. can be ommitted.
if(!M.it) //In case you have more than one person who's it.
world << "[src] tagged [M]!"
it = 0 //Once again, this is a short way of writing src.it = 0
M.it = 1

Logout() //When a client "logs out" of a mob. This is not neccessarily leaving the game.
if(it) //If you're logging out while it.
var/list/Clients = list() //A list of clients.
for(var/client/C in world) //For all the clients (players connected to the game)
if(C.mob != src) //If the client's mob isn't src.
if(!C.mob.it) //And if they aren't it.
Clients += C //Add C to the list.
if(length(Clients)) //If there's anything in the list.
var/client/CLI = pick(Clients) //Picks someone from the list.
world << "[CLI.mob] is the new IT!"
CLI.mob.it = 1 //Set their mob to be it.
del(src) //Delete the old mob.
i've tried a tag game before and to fix that error you get when compiling you need to change the word "tag" to something else. i used tag_player when i did it.
In response to Garthor
Thanks so much. That helps a whole lot.
In response to Dude-san
Oh, wait. I need to implement a "Newcomer's it" rule. I try, but I can't seem to get the user who just logged in to get the tag command. Can anyone help? I've tried using 'usr.it = 1', 'src.it = 1', and 'it = 1' in my Login() proc.
In response to Dude-san
Nevermind, fixed it. =)