ID:147893
 
Hm. The following code is part of my dinky little paintball system.

            Join2()
set category = "Paintball"
set name = "Join"
line = inline
inline += 1
paintplayers += 1
remaining -= 1
usr << "<font color=green><b>Joining, please wait...</font></b>"
usr.verbs -= /mob/Cheats/verb/Join2
world << "<font color=red><u><b>INFO:</font></u></b><font color=white><b> [usr] has joined the free-for-all! [remaining] player(s) are needed yet!</font></b>"
if(paintplayers == 4)
paintballin = 1
for(var/mob/M in world)
M.verbs -= /mob/Cheats/verb/Join2
if(M.line == 1)
M.loc = locate(161,159,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
if(M.line == 2)
M.loc = locate(161,122,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
if(M.line == 3)
M.loc = locate(199,122,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
if(M.line == 4)
M.loc = locate(199,159,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
inline = 0
remaining = 0

The vars are defined and assigned correctly to the best of my knowledge, but after the fourth player joins they don't get "teleported" to their specific location on the destination map, or get the shoot verb, etc. Arg.
bleh!! always put your code in the dm tags!
<dm>
code here

and close it with <\dm> (use / instead of \)
First, I'd like to say that you should use more descriptive topic titles.

Your problem appears to be that you have inline set to 0, and it changes after you set the joining player's line to inline. That means that player 1's line will be 0, player 2 will have 1, ect... Because of this, one player won't be affected by that for-loop because his line (0) won't be in those if statements.

Make sure inline starts at 1.
In response to Evil Incarnate Inc
Evil Incarnate Inc wrote:
bleh!! always put your code in the dm tags!
> <dm>
> code here
>

and close it with <\dm> (use / instead of \)

It looks to me like he did use the dm tags. Maybe he edited it after said that, I don't know. But it shows up that way to me.
In response to Loduwijk
Yeah, I did edit it and put the DM tags in there shortly after he said it.

I changed the default inline verb to 1, so when one starts an FFA, their line var is set to 1 and then inline is increased by one, then when the others join their line var is set to inline, then inline gets incremented by one, etc. But even now that that's fixed(that was most likely one of the problems, thanks!) the players still don't get taken to the paintball field after the paintplayers var reaches four.
In response to Enigmaster2002
But even now that that's fixed(that was most likely one of the problems, thanks!) the players still don't get taken to the paintball field after the paintplayers var reaches four.

As far as i can see, you have only defined the location for the first four people that join the paintballing circuit (or what ever it is). An idea could be for everyone else to be teleported to a waiting area, and then let then rejoin the paintball later on. Also, its the same with the shoot verb. It is only allocated if a person has properly joined and been teleported to the paintballing range.
In response to Lazyboy
Well, I might end up placing those who join after the amount of players has beeen reached into a waiting area, and the players are not supposed to recieve the shoot verb until they get there, I did that intentionally. I messed around with tthis whole thing a bit, and I'll post the coding that applies to the situation:
mob
Cheat
verb
Join2()
set category = "Paintball"
set name = "Join"
line = inline
inline += 1
paintplayers += 1
remaining -= 1
usr << "<font color=green><b>Joining, please wait..."
usr.verbs -= /mob/Cheats/verb/Join2
world << "<font color=red><u><b>INFO:</font></u></b><font color=white><b> [usr] has joined the free-for-all! [remaining] player(s) are needed yet!"
if(paintplayers == 4)
for(var/mob/M in world)
M.verbs -= /mob/Cheats/verb/Join2
if(M.line == 1)
M.loc = locate(161,159,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
if(M.line == 2)
M.loc = locate(161,122,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
if(M.line == 3)
M.loc = locate(199,122,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
if(M.line == 4)
M.loc = locate(199,159,2)
M.line = 0
M.verbs += /mob/Cheats/verb/Shoot
M.client.verbs -= typesof(/mob/Build/verb)
M.painty = 1
inline = 1
remaining = 4

mob
verb
FFA_Paintball()
usr.line = inline
inline += 1
remaining -= 1
paintballin = 1
paintplayers += 1
for(var/mob/M in world)
M.verbs += /mob/Cheats/verb/Join2
M << "<font color=red><u><b>INFO:</font></u></b><font color=white><b> [usr] has opened a four player free for all! Use 'Join' in the 'Paintball' tab to join!"
usr.verbs -= /mob/Cheats/verb/Join2

var
remaining = 4
inline = 1
paintplayers = 0
paintballin = 0
In response to Enigmaster2002
Try checking if(paintplayers >= 4), rather than if(paintplayers == 4).
In response to Crispy
Nope, still won't teleport the players to the paintball course.