mob/proc
Update_Who()
set background = 1
var/Row = 1//used to represent the row which should be used
var/People = list()//use this to represent the people online
var/A = 0//use this to represent the number of people online
winset(src, "P-Main.Who", "cells=0x0")//whipes the who grid clean for the update to come
src << output("<center><font size =1><font color = red>Name","Who:[1],[Row]")//adds the title name to the grid
src << output("<center><font size =1><font color = red>Status","Who:[2],[Row]")//adds the title status to the grid
A += Players//add the number of players online to the temporary var so that it doesnt affect the Players var during the proces
People += Online//add the online people to the temporary list so as to leave the Online list from being affected by the process
Row += 1//add 1 to Row so that what comes next uses row 2 and not row 1
sleep(0)
while(A)//this will loops the process while A is still greater than 0
for(var/mob/M in People)//finds a person in the People list
src << output("<center><font size =1>[M.key]","Who:[1],[Row]")//displays this person's key in the grid
src << output("<center><font size =1>[M.Status]","Who:[2],[Row]")//displays this persons's status in the grid
People -= M//removes the person from the list so there not repeated
Row += 1//makes the Row var increase by 1 so the next process will use the row bellow the current row and wont mess up the system
A -= 1//removes 1 number from A. A's number co-ensides with the number of people in People so when A hits 0 it means there isnt anyone in the list and stops the process
sleep 1//gives a delay of 1/10 seconds to stop infinite loop problems.
if(A == 0)//this will occur once the while(A) stops it'le display the number of players bellow the last name.
src << output("<center><font size =1>Players :","Who:[1],[Row]")
src << output("<center><font size =1>[Players]","Who:[2],[Row]")
Row += 1
..()
The problem is that when i have more than 1 user,and 1 logs off im stuck with 2 players rows.I never worked with grids before so how can i fix this problem?
That might interest you, considering I've little idea what you're trying to do there.