When i hosted my game and i have this var/People = 0
mob/Login()
if(!People)
alert("You are the descendent of the great Erdrick.")
usr.icon = 'Erdrick.dmi'
src.loc=locate("King")
..()
else
src<<"This is a one player game!"
del(src)
so its only supposed to be one player
yes tothere people joined my game
ID:179624
Nov 26 2001, 3:07 pm
|
|
I had this question awhile ago myself...lemme try to help you out. First of all....you need to give the world a var, like so,
var People Then when somone logs in, you can add one to this or something. Then when somone else logs in, or tries to, hehe, have it check to see if the people var is at it's max, one in this case, and if it is, then del(src) or whatever.Hope this helped. |
In response to Lummox JR
|
|
Oh so would i do this
mob/Login() var/People = 0 usr.People=1 if(!People) alert("You are the descendent of the great Erdrick.") usr.icon = 'Erdrick.dmi' src.loc=locate("King") ..() else src<<"This is a one player game!" del(src) Would this work |
In response to Greg
|
|
I treid it and got a bad
src var mob var |
In response to Greg
|
|
No, it wouldn't because you add to the var before the check and no one would be able to join period:
mob/Login() Oh yes, and make Players a global var or it won't work. |
Okay, I can't manage to make any sense of that. But the problem you're having is that in the if(!People) block, when the player logs in you don't set People to 1. So when a second player logs in, People is still 0 and so the same block of code executes.
Lummox JR