ID:171120
 
I am making a trigun game and instead of ppl just shooting everybody they have to be in a battle "arena" sort of thing. I need a command that asks the person who they want to fight. I can get that far but I also need it to ask the person they challenged to accept and then teleport them to a "arena", plz help
mob
var
induel = 0

verb
startduel()
induel = 1
var/mob/challenged = input("challenge who?","Duel") as mob in world
if(challenged.induel == 0)
var/duel = alert(challenged,"Do you want to duel [src]?","Duel","Yes","No")
if(duel == "Yes")
challenged.induel = 1
src.loc = locate(1,1,1) // !CHANGE THIS!
challenged.loc = locate(2,2,1) // !CHANGE THIS!
src.verbs -= /mob/verb/startduel
challenged.verbs -= /mob/verb/startduel
else
alert(src,"sorry [challenged] does not want to duel","Duel")
induel = 0
return
else
alert(src,"sorry [challenged] is allready in a duel","Duel")
induel = 0
return

/*
when the duel is over dont forget to

relocate them
give them back there duel verb
reset there induel var back to 0
*/

hope that helps its just a small basic system that
checks a var so it can tell if there in a duel
and if there not it a duel it asks them if they want to duel
then if sends to to the duel area (you need to set that up)

thou the code is UNtested it does build thats more than i
normaly do.
In response to Madpeter
Madpeter got a little confused! you see he made it so that it checked if they were dueling to continue with the dueling process after he already changed it so they were dueling. This can easily be fixed though =P. Just make the
usr.induel = 1
happen after the duel check!