ID:138865
 
Code:
var/tournament = 0
var/match = 0
var/list/Entries = list()
var/started=0
var/list/Winners = list()
mob/var/tmp/tourny=0
mob/Tournament
verb
Enter_Tournament()
set category = "Tournament"
set name = "Enter Tournament"
if(usr.dead)
usr<<"\red You are dead!"
return

if(usr.level<=500)
usr<<"You are not a combatant, train more!"
return
if(started)
usr<<"<font color=white>The tournament has already started</font></b></u>"
return
if(tournament == 0)
usr<<"<font color=white>Tournament isn't open yet."
return
if(usr.tourny)
usr<<"<font color=white><b><u>You're already in the tournament!</font></b></u>"
return
else
usr.loc=locate(rand(76,96),rand(69,74),7)
Entries.Add(usr)
usr.tourny=1
world<<"<font color=white><b><u>[usr] joined the tournament!</font></b></u>"
Leave_Tournament()
set category = "Tournament"
set name = "Leave Tournament"
if(tournament == 0)
usr<<"<font color=white>Tournament isn't open yet."
return
if(usr.tourny == 0)
usr<<"<font color=white><b><u>You're not in the tournament!</font></b></u>"
return
else
usr.loc = locate(154,165,1)
usr.tourny=0
Entries.Remove(usr)
world<<"<font color=white><b><u>[usr] left the tournament!</font></b></u>"


mob/System/Admin/Verbs
LowGM/verb
Begin()
set category="Admin"
set name="Start Auto Tournament"
switch(alert("Are you sure you wish to start an automatic tournament?","Confirm","Yes","No"))
if("No")
return
if("Yes")
if(tournament)
usr<<"There's already a tournament going on!"
return
tournament=1
world << "<center><font size=3><font color = red><b><center>[usr] has started an automatic tournament, the prize is your choice!<br><font size = 1>To join please go to Tournament tab and select Enter Tournament."
AutoStartTourney()
Stop_Tourny_Entance()
set category="Admin"
set name="Stop Auto Tournament"
if(tournament&&!started&&!match)
AutoStopTourney()

proc
Prize(var/mob/M in Winners)
world<<"Tournament News: [M] has won the world tournament and will recieve a prize of their choice"
started=0
var/prize
prize=input(M,"Congratulations, You Won! Please Select Your Prize")in list("Strength","Defence","Ki","PowerLevel")
switch(prize)
if("Strength")
M.strength_max+=1000000
M.strength = M.strength_max
M<<"<font color=#5f9ea0>You have been blessed with more Strength."
if("Defence")
M.defence_max+=1000000
M.defence = M.defence_max
M<<"<font color=#5f9ea0>You have been blessed with more Defence."
if("Ki")
M.ki_max+=1000000
M.ki = M.ki_max
M<<"<font color=#5f9ea0>You have been blessed with more Ki."
if("PowerLevel")
M.powerlevel_max+=1000000
M.powerlevel = M.powerlevel_max
M<<"<font color=#5f9ea0>You have been blessed with more Power."
M.loc = locate(154,165,1)
proc
KILLTOURNY()
for(var/mob/M in world)
M.verbs -= typesof(/mob/Tournament/verb)
if(M.tourny)
M.tourny = 0
Entries.Remove(M)
M.loc = locate(154,165,1)
tournament=0
started=0
spawn(18000) AutoStartTourney()

proc
AutoStartTourney()
if(tournament == 1)
return
else
world << "<center><font size=3><font color = red><b><center>The World Tournament has begun! You have 2 minutes to enter.<br><font size = 1>To join please go to Tournament tab and select Enter Tournament."
tournament = 1
for(var/mob/M in world)
M.verbs += new/mob/Tournament/verb/Enter_Tournament()
M.verbs += new/mob/Tournament/verb/Leave_Tournament()
for(var/mob/Q in Entries)
Entries.Remove(Q)
for(var/mob/S in Winners)
Winners.Remove(S)
spawn(1200) AutoStopTourney()
AutoStopTourney()
if(tournament == 1)
world << "<center><font size=2><font color = red><b><center>The tournament entry has now ended."
world << "<font size=1><font color = red><b>The following people are in the tournament"
started=1
for(var/mob/M in world)
if(M.tourny)
world << "[M]"
for(var/mob/M in world)
M.verbs -= new/mob/Tournament/verb/Enter_Tournament()
M.verbs -= new/mob/Tournament/verb/Leave_Tournament()
if(Entries.len<=1 && Winners.len<1)
started=0
world<<"<center><font size=2><font color=#5f9ea0>Not enough players, Tournament cancelled."
for(var/mob/PC/M in world)
M.verbs -= new/mob/Tournament/verb/Enter_Tournament()
M.verbs -= new/mob/Tournament/verb/Leave_Tournament()
tournament=0
KILLTOURNY()
Tournament_AI()

proc
Tournament_AI()
started=1
if(Entries.len<1 && Winners.len<1)
world<<"<center><font size=3><font color=#5f9ea0>Tournament over, all contestants have left..."
for(var/mob/C in world)
if(C.client)
C.tourny=0
KILLTOURNY()
started=0
return
if(Entries.len<1 && Winners.len==1)
tournament=0
world<<"<center><font size=3><font color=#5f9ea0>Tournament over, winner is:"
for(var/mob/M in Winners)
world<<M
Prize(M)
Entries=list()
Winners=list()
for(var/mob/C in world)
if(C.client)
C.tourny=0
started=0
return
if(Entries.len < 2)
NextRound()
else
FixEntries()
if(match)
return
if(!Entries||Entries.len<2)
Tournament_AI()
return
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: Are you ready for battle?"
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: Next up is..."
sleep(15)
Matches()
FixEntries()
var/list/Cop=list()
for(var/mob/A in Entries)
var/good=1
if(A&&ismob(A)&&A.client&&A.z==5)
for(var/mob/B in Cop)
if(A==B)
good=0
if(good)
Cop+=A
else
Entries=Cop
Matches()
FixEntries()
if(!Entries||Entries.len<2)
Tournament_AI()
return
var/mob/A=Entries[1]
var/mob/B=Entries[2]
if(!A||!B||A==B||A.z!=7||B.z!=7)
Matches()
return
match=1
if(!(A && B))
match=0
Tournament_AI()
return
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: [A] V.S. [B]!"
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: You have 30 seconds to prepare yourselves!"
sleep(300)
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: 3!"
sleep(10)
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: 2!"
sleep(10)
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: 1!"
sleep(10)
if(!A||!B||A==B||A.z!=7||B.z!=7)
match=0
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: Match Cancelled..."
Tournament_AI()
return
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: FIGHT!"
sleep(1)
if(!A||!B||A==B||A.z!=7||B.z!=7)
match=0
world<<"<center><font size=3><font color=#5f9ea0>Tournament Announcer: Match Cancelled..."
Tournament_AI()
return
if(A)A.loc=locate(82,57,7)
if(B)B.loc=locate(90,57,7)
Fight(A,B)
FixEntries()
match=0
Tournament_AI()

proc
Fight(mob/A,mob/B)
while(1)
if(!B || B.z != 7 || B.dead)
if(!B)
world<<"<center><font size=3><font color=#5f9ea0>[A] has won his round because his opponent has left!"
else
world<<"<center><font size=3><font color=#5f9ea0>[A] has eliminated [B]!"
Entries.Remove(B)
B.tourny=0
Winners.Add(A)
Entries.Remove(A)
A.loc=locate(rand(76,96),rand(69,74),7)
return
if( !A || A.z != 7 ||A.dead)
if(!A)
world<<"<center><font size=3><font color=#5f9ea0>[B] has won his round because his opponent has left!"
else
world<<"<center><font size=3><font color=#5f9ea0>[B] has eliminated [A]!"
Entries.Remove(A)
A.tourny=0
Winners.Add(B)
Entries.Remove(B)
B.loc=locate(rand(76,96),rand(69,74),7)
return
else
sleep(1)
NextRound()
for(var/mob/M in Winners)
Entries.Add(M)
M.loc=locate(rand(76,96),rand(69,74),7)
sleep(10)
Winners.Remove(M)
if(Entries.len<2)
return
world<<"<center><font size=3><font color=#5f9ea0>Tournament News: The next round will now begin!"
Tournament_AI()

Problem description:
the problems:
torneo.dm:127:error: inconsistent indentation
torneo.dm:128:error: inconsistent indentation


in this part:
if(M.tourny)
world << "[M]"
Your indentation is inconsistent on those 2 lines, make it consistent with the rest of the block.

Did you even read the error?
In response to Robertbanks2
Robertbanks2 wrote:
Your indentation is inconsistent on those 2 lines, make it consistent with the rest of the block.

Did you even read the error?
can you fix the code please?
From the looks of it you're using someone else's code if you can't fix something as simple as an indention error.

From what I can tell, you're indenting the part you pointed out with spaces, even though the rest of the code appears to be indented with tabs. You cannot mix tabs and spaces.

This is also a completely horrible way of handling tournaments in general and would suggest you throw it out and start over.

Edit: Woops, Robert beat me to it.
In response to LordAndrew
ey i add spaces and quit spaces but dont fix :S
i try to fix, i add and quit spaces but this code dont good :S
In response to Alonsinho
Stop ripping DBZ games and people will probably be more helpful. You should also try actually learning the language, there are plenty of tutorials and resources in the developer section.
In response to Robertbanks2
ok, but fxed the code please and i shut up =)