ID:145443
 
Code:
    proc
Out()
src << "<font color = red><b>You're out!<br>You must now observe.</b></font>"
src.invisibility = 101
src.verbs -= new/mob/PC/verb/Fire1
src.verbs -= new/mob/PC/verb/Fire2
src.out = 1
sleep(30)
if(src.field == "A")
if(src.team == 1)
f1t1 --
if(f1t1 <= 0)
for(var/mob/PC/M in world)
if(f1t2L == "[M.name]")
for(var/mob/PC/U in M.party)
U.money += 50
if(U.out)
U.invisibility = 0
U.verbs += /mob/PC/verb/Fire1
U.verbs += /mob/PC/verb/Fire2
U.hits = 0
U.out = 0
U.hits = 0
U.loc = locate(2,2,1)
if(f1t1L == "[M.name]")
for(var/mob/PC/S in M.party)
if(S.out)
S.invisibility = 0
S.verbs += /mob/PC/verb/Fire1
S.verbs += /mob/PC/verb/Fire2
S.hits = 0
S.out = 0
S.hits = 0
S.loc = locate(2,2,1)
world <<"<font color = blue><b> Team 2 is victorious at field A!</font>"
var/obj/RefereeA/O = new /obj/RefereeA(src.loc)
O.loc = locate(9,8,1)
if(src.team == 2)
f1t2 --
if(f1t2 <= 0)
for(var/mob/PC/M in world)
if(f1t1L == "[M.name]")
for(var/mob/PC/U in M.party)
U.money += 50
if(U.out)
U.invisibility = 0
U.verbs += /mob/PC/verb/Fire1
U.verbs += /mob/PC/verb/Fire2
U.hits = 0
U.out = 0
U.loc = locate(2,2,1)
if(f1t2L == "[M.name]")
for(var/mob/PC/S in M.party)
if(S.out)
S.invisibility = 0
S.verbs += /mob/PC/verb/Fire1
S.verbs += /mob/PC/verb/Fire2
S.hits = 0
S.out = 0
S.hits = 0
S.loc = locate(2,2,1)
world <<"<font color = blue><b> Team 1 is victorious at field A!</font>"
var/obj/RefereeA/O = new /obj/RefereeA(src.loc)
O.loc = locate(9,8,1)
if(src.field == "B")
if(src.team == 1)
f2t1 --
if(f2t1 <= 0)
for(var/mob/PC/M in world)
if(f2t2L == "[M.name]")
for(var/mob/PC/U in M.party)
U.money += 50
if(U.out)
U.invisibility = 0
U.verbs += /mob/PC/verb/Fire1
U.verbs += /mob/PC/verb/Fire2
U.hits = 0
U.out = 0
U.loc = locate(2,2,1)
if(f2t1L == "[M.name]")
for(var/mob/PC/S in M.party)
if(S.out)
S.invisibility = 0
S.verbs += /mob/PC/verb/Fire1
S.verbs += /mob/PC/verb/Fire2
S.hits = 0
S.out = 0
S.hits = 0
S.loc = locate(2,2,1)
world <<"<font color = blue><b> Team 2 is victorious at field B!</font>"
var/obj/RefereeB/O = new /obj/RefereeB(src.loc)
O.loc = locate(2,8,1)
if(src.team == 2)
f2t2 --
if(f2t2 <= 0)
for(var/mob/PC/M in world)
if(f2t1L == "[M.name]")
for(var/mob/PC/U in M.party)
U.money += 50
if(U.out)
U.invisibility = 0
U.verbs += /mob/PC/verb/Fire1
U.verbs += /mob/PC/verb/Fire2
U.hits = 0
U.out = 0
U.loc = locate(2,2,1)

if(f2t2L == "[M.name]")
for(var/mob/PC/S in M.party)
if(S.out)
S.invisibility = 0
S.verbs += /mob/PC/verb/Fire1
S.verbs += /mob/PC/verb/Fire2
S.hits = 0
S.out = 0
S.hits = 0
S.loc = locate(2,2,1)
world <<"<font color = blue><b> Team 1 is victorious at field B!</font>"
var/obj/RefereeB/O = new /obj/RefereeB(src.loc)
O.loc = locate(2,8,1)

Here's the Referee Code incase it's needed

obj
RefereeA
icon = 'Player.dmi'
icon_state = "referee"
density = 1
var
team1
team2
verb
Join_Game()
set src in oview(1)
if(usr.in_party)
if(usr.name == "[usr.party_leader]")
switch(input("Would You like to enlist your team?") in list ("Yes","No"))
if("Yes")
if(!src.team1)
src.team1 = "[usr.party_leader]"
f1t1L = "[usr.party_leader]"
usr << "<font color = green> Your team is enlisted as team 1!</font>"
else
if(!src.team2)
src.team2 = "[usr.party_leader]"
f1t2L = "[usr.party_leader]"
usr << "<font color = green>Your team is enlisted as team 2!</font>"
world << "<font color = blue><b> The Game at Field A is about to begin!</b></font>"
for(var/mob/M in world)
if(M.name == "[src.team1]")
for(var/mob/U in M.party)
U.loc = locate(2,2,2)
world << "<font color = green>Member of Team 1 ready in field A!</font>"
U.field = "A"
f1t1 += 1
U.team = 1
if(M.name == "[src.team2]")
for(var/mob/S in M.party)
S.loc = locate(24,24,2)
world << "<font color = green>Member of Team 2 ready in field A!</font>"
S.field = "A"
f1t2 += 1
S.team = 2
sleep(40)
del(src)
else
usr << "The game has begun."
else
usr << "Only the leader of your party can enlist you!"


Problem description:
This little problem has been giving me quite a bit of angst over the past two days. It's probably a pretty simple solution, but I'm missing it. What happens is it works perfectly the first time but the second time when a team is defeated/player gets out - it doesn't relocate and reset each player or the referee.
Bumped.
Just wondering if you are resetting your "f1t1" variables to reflect that there are players in the game again once a new game begins. It seems that may be the problem from the way you described how it does not work. Or when the game ends, do you have to use the Join Game verb again, if so, I never looked too closely at the code, and can't help too much until I do. If what I said fixes the problem, I won't bother to read over the code closer, but if it doesn't I will try and help out more.
In response to Satans Spawn
Hey it worked thanks - pretty stupid of me to not think of that ;)
In response to Worldweaver
Meh, we all do things like that. I spent almost a hour lastnight messing around with a proc, wondering why it was acting so odd(Calling a statement true when it was clearly false, and everything agreed with the results being false), untill I realized that else if doesn't exist in a switch(). I "knew" that, but I didn't even think about it when I typed
switch(A)
if(B)
else if(C)
else if(A)


Case C was returning true, even though C!=A. That was an example by the way, not actually what I was working with. I was getting very angry with it. Most programing languages just use case() rather than if() in a switch().

Point is, don't feel stupid, it was a small mistake that was unclear to the one who actually wrote it, because you read what you thought, not what you wrote.
In response to Scoobert
:) Thanks