ID:169147
 
is there a way to define a usr as a var like player1 2 3 4 ect.? like for instants instead of going thru all that i could do....
join()
player1="[usr]"
then just say
player1.loc=locate(x,y,z)
or somthing like that?
or is there a demo to show how to set players and do somthing similair? thnx.
var
players = 0


mob/Login()
players ++
var/list/player[0]

mob/Login()
player+=src
..()
mob/Logout()
player-=src

Then to use it.
mob/proc/MyProc()
var/mob/M = player[1]
M.loc = locate(x,y,z)

Of course, you can put any number associated with a player into those brackets. So you could do player[2] or player[3] or whatever.
In response to Loduwijk
thnx, now how do i set it up from that if i only want so many players to be able to join?? for instance...
if(player[3])
return
or how would i do this?
(i only want it set up for 2 players)
In response to Bladeshifter
This should work:

if(length(players) == 2)
del(src)

In response to Bladeshifter
Bladeshifter wrote:
thnx, now how do i set it up from that if i only want so many players to be able to join?? for instance...
if(player[3])
return
or how would i do this?
(i only want it set up for 2 players)
F'god's sakes, man, use dm tags.