ID:139130
 
Code:
//I highly recomend having a 'safe' var for this code to work propperly
//you'll have to insert the 'safe' var into the code
//in certain areas to keep people from attacking one another
//during waiting times during the tournament


/*world
New()
spawn(150) Start_Auto_Tournament_System()*/

//to have the system start automaticly remove the /* and */ from the above lines
mob
var
tmp/tourny = 0

var/tournament_entry = 0
var/tournament = 0
mob/Login()
if(tournament==1 && tournament_entry)
src.verbs += new/mob/Auto_Tournament/verb/Enter_Auto_Tournament()
src.verbs += new/mob/Auto_Tournament/verb/Leave_Auto_Tournament()
if(src.key=="")//insert your key here
src.verbs += typesof(/mob/Auto_Tourny/verb/)

//this is where King-manga-man's Tournament System is used
mob/Auto_Tournament
verb
Enter_Auto_Tournament()
set category = "Tournament"
set name = "Enter Tournament"
if(usr.tourny == 1)
usr<<"<font color=white><b><u>You're already in the tournament!</font></b></u>"
return
else
usr.loc=locate(rand(,),rand(,),)//send them to a 'waiting room'.
usr.tourny=1//i recomend making the usr 'safe' aswell
Contenders.Add(usr)
world<<"<center><font color=white><b><u><font color=aqua>[usr]</font color=aqua> has joined the tournament!</b></u></font color=white>"


Leave_Auto_Tournament()
set category = "Tournament"
set name = "Leave Tournament"
if(usr.tourny == 0)
usr<<"<font color=white><b><u>You're not in the tournament!</font></b></u>"
return
else
usr.loc=locate(,,)//send them to a spawn.
usr.tourny=0//if moving them into a 'safe zone' i recomend making the usr 'safe' aswell
Contenders.Remove(usr)
Contenders -= usr
world<<"<center><font color=white><b><u><font color=maroon>[usr]</font color=maroon> has left the tournament!</b></u></font color=white>"



mob/Logout()
src.verbs -= new/mob/Auto_Tournament/verb/Enter_Auto_Tournament()
src.verbs -= new/mob/Auto_Tournament/verb/Leave_Auto_Tournament()
Contenders.Remove(src)




////////////////////////////////////////////////////////
///////////////////Auto Tourny System///////////////////
/////////////////////////Sketh//////////////////////////
///////////////////Done From Scratch////////////////////
////////////////////////////////////////////////////////
//////////////////////////P.S.//////////////////////////
//////////////////////Like a boss.//////////////////////
////////////////////////////////////////////////////////


var/auto_tournament = 0
var/list/Contenders = list()
mob/var/prizecollect=0
mob/var/tournywin=0

mob/proc
Check_Prize(mob/W)
if(W.tournywin>W.prizecollect)
switch(input (W,"What do you want your prize to be?") in list ("", "", "", "", "", "", "Random"))
if("")
if(W.tournywin>W.prizecollect)//You have to insert the prizes into the coding.
W<<"You have gained"
W.prizecollect+=1
return
if("")
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
return
if("")
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
return
if("")
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
return
if("")
if(W.tournywin>W.prizecollect)
W<<"You have gained ."
W.prizecollect+=1
return
if("Random")
var/random_prize=rand(1,6)
if(random_prize==1)
if(W.tournywin>W.prizecollect)
W<<"You have gained ."
W.prizecollect+=1
if(random_prize==2)
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
if(random_prize==3)
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
if(random_prize==4)
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
if(random_prize==5)
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
if(random_prize==6)
if(W.tournywin>W.prizecollect)
W.prizecollect+=1
W<<"You have gained ."
return

proc
Check_Contestents(mob/A,mob/B)
fight
if(!A && !B)
world<<"Both [A] and [B] have left."
Tourny_System()
return
if(!A)
B.loc=locate(rand(,),rand(,),)//waiting room again
world<<"[A] has left! [B] is the winner!"
Tourny_System()
return
if(!B)
A.loc=locate(rand(,),rand(,),)
world<<"[B] has left! [A] is the winner!"
Tourny_System()
return

//if you have a after-life deal and a death proc feel free to use this.

/*if(A.dead)
Contenders.Remove(A)
B.loc=locate(rand(,),rand(,),)
world<<"[A] has fallen! [B] is the winner!"
Tourny_System()
return

if(B.dead)
Contenders.Remove(B)
A.loc=locate(rand(,),rand(,),)
world<<"[B] has fallen! [A] is the winner!"
Tourny_System()
return*/


if(A.z!=)//insert the 'z' plane the tournament arena is in
Contenders.Remove(A)
B.loc=locate(rand(,),rand(,),)
world<<"[A] has fallen! [B] is the winner!"
Tourny_System()
return

if(B.z!=)//insert the 'z' plane the tournament arena is in
Contenders.Remove(B)
A.loc=locate(rand(,),rand(,),)
world<<"[B] has fallen! [A] is the winner!"
Tourny_System()
return

spawn(7)
goto fight



proc
Tourny_System()
if(Contenders.len == 1)
var/W=pick(Contenders)
W:tournywin++
W:Check_Prize(W)
W:loc = locate(,,)//spawn
W:tourny=0//i recomend making the usr 'safe' aswell
Contenders.Remove(W)
for(var/mob/R in world)
R.tourny=0
if(auto_tournament==1)
world<<"<center><font color=blue>The Tournament has ended! [W] is your champion! Tournament entry will re-open in <font color=green>(45 minutes)</font color=green>."
tournament=0
Contenders=null
Contenders=list()
spawn(27000) Start_Auto_Tournament()
return
else
if(auto_tournament==0)
world<<"<center><font color=red>The Tournament has ended! [W] is your champion! The Auto-Tournament has been closed until further notice."
tournament=0
Contenders=null
Contenders=list()
return
else
if(Contenders.len == 2)
here
var/A=pick(Contenders)
var/B=pick(Contenders)
if(A==B)
goto here
world<<"<font color=teal><center>The final match in the tournament is... [A] vs [B]!!!"
sleep(5)
A<<"You have <font color=blue>(20)</font color=blue> seconds."
B<<"You have <font color=blue>(20)</font color=blue> seconds."
sleep(200)//i recomend making both 'unsafe' if you've implamented the safe var previously
A:loc = locate(,,)//tournament area 1
B:loc = locate(,,)//tournament area 2
A<<"FIGHT!"
B<<"FIGHT!"
Check_Contestents(A,B)
else
if(Contenders.len > 2)
world<<"The first round of the Tournament is about to begin"
here
var/A=pick(Contenders)
var/B=pick(Contenders)
if(A==B)
goto here
world<<"<Font color=navy>The Tournament's first match is... [A] vs [B]!!!"
A<<"You have <font color=blue>(20)</font color=blue> seconds."
B<<"You have <font color=blue>(20)</font color=blue> seconds."
sleep(200)//i recomend making both 'unsafe' if you've implamented the safe var previously
A:loc = locate(,,)//tournament area 1
B:loc = locate(,,)//tournament area 2
A<<"FIGHT!"
B<<"FIGHT!"
Check_Contestents(A,B)
else
if(!Contenders.len)
world<<"The are no more participents in the automatic tournament, tournament cancled."
world<<"<center><font color=blue>The Tournament has ended! Tournament entry will re-open in <font color=green>(45 minutes)</font color=green>."
tournament=0
spawn(27000) Start_Auto_Tournament()
return


proc
Start_Auto_Tournament()
if(tournament==1)
return
if(auto_tournament==1)
world << "<center><font size=3><font color = navy><b><center>The Auto Tournament is about to begin! Please join via the Tournament tab."
tournament = 1
tournament_entry = 1
for(var/mob/M in world)
M.verbs += new/mob/Auto_Tournament/verb/Enter_Auto_Tournament()
M.verbs += new/mob/Auto_Tournament/verb/Leave_Auto_Tournament()
sleep(1200)
tournament_entry = 0
for(var/mob/L in world)
L.verbs -= new/mob/Auto_Tournament/verb/Enter_Auto_Tournament()
L.verbs -= new/mob/Auto_Tournament/verb/Leave_Auto_Tournament()
if(Contenders.len < 2)
world<<"<center><font color=maroon>The Auto Tournament does not have enough contestents! Tournament entry will re-open in <font color=red>(45 minutes)</font color=red>."
tournament=0
Contenders=null
Contenders=list()
for(var/mob/S in Contenders)
S:tourny=null
S:loc = locate(,,) //spawn
spawn(27000) Start_Auto_Tournament()
return
else
world<<"<center><font size=2<font color=olive><b>The Auto Tournament entry has ended."
Tourny_System()
proc
Start_Auto_Tournament_System()
if(auto_tournament == 1)
usr<<"The Auto Tournament system is currently active."
return
else
auto_tournament=1
Start_Auto_Tournament()
mob
Auto_Tourny
verb

Start_Auto_Tourn()
set category = "Owner"
set name = "Tournament: Start Auto System"
Start_Auto_Tournament_System()

Stop_Auto_Tournament_System()
set category = "Owner"
set name = "Tournament: Stop Auto System"
if(auto_tournament==0)
usr<<"The Auto Tournament system is currently offline."
return
else
auto_tournament=0
if(tournament==1)
usr<<"The auto tournament system will shut down after the current tournament."
else
world<<"[usr] has ended the auto tournament system"


Problem description:
loading Dragonball z dark society.dme
auto tourney finally.dm:162:error: missing expression
auto tourney finally.dm:169:error: missing expression

Dragonball z dark society.dmb - 2 errors, 0 warnings (double-click on an error to jump to it)


That's certainly a lot of terrible code that you probably didn't make with no indication as to what the lines with errors are on.
My advice would be to ditch the source code or code snippets you are apparently using, and create your own tournament system. Why? Because when you use someone else's poorly-documented code you'll have a hard time pinpointing bugs. Nobody is about to trudge through a bunch of irrelevant code just to pinpoint the problem for you.
In response to Duelmaster409
i fixed it
In response to LordAndrew
mob/Login()
if(tournament==1 && tournament_entry)
src.verbs += new/mob/Auto_Tournament/verb/Enter_Auto_Tournament()
src.verbs += new/mob/Auto_Tournament/verb/Leave_Auto_Tournament()
if(src.key=="")//insert your key here
src.verbs += typesof(/mob/Auto_Tourny/verb/)</D>

Also wouldn't this part cause a black screen because he is overriding mob/Login() and there is no ..()?
It is actually, because it's terrible. It's not something that should be posted as a resource for anyone to use. If you want to make poorly programmed snippets keep them to yourself.