ID:262896
 
Code:
mob
verb
Arena_Challenge()
var/challenger=input("Who do you want to fight?","Arena Man")as mob in world
switch(alert(challenger,"[usr] wants to fight!, Do you accept?","Arena Man","Yes","No"))
if("Yes")
usr.loc=locate(87,92,21)
challenger:loc=locate(97,92,21)
if("No")
usr << "[challenger] has declined your challenge!"


Problem description:I dont really know how to approach this...I want it to make sure that only one group is aloud in at a time...and when someone dies while in it, you will be teleported back to your original place that you were at before and there will be an announcement like "HUMBLAH HAS DEFEATED BLAH" or something...

Help Please


ok heres what your going to need to track and edit

a var that says if there in the arena or not
mob
var
tmp
inarena = 0 // tmp var to control if they are in the arena


then a edited death proc heres an example
mob
proc
death(mob/killer)
if(inarena)
world << "[src.name] was beaten by [killer.name] in the arena!" // theres no player list so world will have to do.
inarena = 0
players_in_arena--
else
// normal death proc

and then some controls for the arena
var
tmp
maxplayers_in_arena = 2
players_in_arena = 0

area
arena
entered(mob/player)
if(!player.inarena)
player << "you are not ment to be here"
player.loc = locate(1,1,1) // send them away

mob
npc
arena_npc
name = "Arena guard"
Click()
var/joinarena = alert(usr,"Are you sure you want to enter the arena?","Arena guard - Players in arena [players_in_arena]/[maxplayers_in_arena]","Yes","I changed my mind")
if(players_in_arena < maxplayers_in_arena)
players_in_arena++
usr.inarena = 1
usr.loc = locate(2,4,2) // warp to the arena
else
usr << "The arena is full right now try again later!"

im not at home so this is not tested but it should do what you want it todo

notes:
cover the arena in the area/arena!
do not save/load inarena for players.
do not save/load players_in_arena.

have fun :P
In response to Zmadpeter
Thats not how i wanted it really its not you talking to a person its a verb that u click like challenge...and theres a list and you choose who you wanna fight...then they receive an invite saying would you like to go to fight so and so yes or no? and after someone dies they both get teleported out and it makes a world announcement.