Login() proc. strange problem. in Developer Help
|
|
Ok. Well, what I want to do is when someone logs in. They will get host powers. And then it adds to the amount of people in the world. And then it locates them. I tried locating them using X,Y,Z , and using an area/turf. But whenver they person logs in, all I get is a blank screen. And I don't get host powers. Now this is really strange to me because it worked or me before. But I'll just shut up and let you see the code.
mob/Login()
if(people
if(people==0)//if your the first person
usr<<"You are the host!"//Tell's the usr that they are the host
usr.loc=locate(/turf/Start)
people+=1//adds one person to the var "people"
usr.verbs.Add(/mob/Host/verb/Host_Boot)//adds the host verb Host Boot
usr.verbs.Add(/mob/Host/verb/Set_Player_Cap)
usr.verbs.Add(/mob/Host/verb/Host_Boot)//add the summon verb
usr.verbs.Add(/mob/Host/verb/Mute)//add the summon all command
usr.verbs.Add(/mob/Host/verb/Unmute)//add the Condemn command
HOST=usr.key//the host is the uset
usr.verbs.Add(/mob/Host/verb/Reboot)
usr.verbs.Add(/mob/Host/verb/Ban)
usr.verbs.Add(/mob/Host/verb/Unban)
world.name="Carnage Revolution: [HOST]'s server, 1 person online"//sets up the worlds name to Host people control: the worlds host, 1 person online
else//if they arn't the first person1
usr<<"Welcome to [world.name]!"//welcome them to your game
usr.loc=locate(/turf/Start)
people+=1//adds one to the "people" var
world.name="Host Demo and People Control: Hosted by [HOST], [people] people online"//since there is more than person you hve to tell how many people
else
usr<<"There are too many people come back later!"//tell's the usr that there are too many people and for them to come back later
del(src)//deletes the user
mob/Logout()//when someone logs out
people-=1//subtract that person
del(src)//delete his icon
if(people==1)//if there is only 1 person left in the game
world.name="Carnage Revolution: [HOST]'s server, 1 person online"//changes the worlds name
else
world.name="Carnage Revolution: [HOST]'s server, [people] people online"//changed the worlds name again...
Ignore the comments. As I went through lots of demos and libraries to try and get it to work. -.-
|
Also a big one is that usr is repeated ad nauseum in Login(). Now this isn't a big deal in Login() much of the time, but src is always correct so you should just use that.
Another strange bit is that you put del(src) in too soon in your Logout() proc. As should be obvious, none of the code after that will run.
Lummox JR