ID:178284
 
How can I make it so when the user comes on, it can detect if the user is the one hosting?
        Login()
if(Players==0)
Players = 1
usr << "You are the host!"


You have to define var/global/Players
In response to Garthor
Yeah, also I'm a newbie with World vairables and "var/whatever" so uh, how do I define it? hehe

Garthor wrote:
        Login()
> if(Players==0)
> Players = 1
> usr << "You are the host!"

You have to define var/global/Players
You can start by posting in the correct forum for this kind of thing--Newbie Central.

Read the forum description for general.

Alathon
In response to MartialArtistAbu
You define it by not posting coding problems in the General forum. :P And by typing var/Players outside of any object/proc definitions... that is, not indented at all, not belonging to anything.
In response to Lesbian Assassin
oh crap I posted it in General.. ALWELL, I'M A NEWBIE AND HAVE MY SPECIAL NEWBIE POWAH' TO DO STUPID THINGS, MWAHAHHA, FEAR ME
In response to MartialArtistAbu
....... ok you do that.....
In response to Garthor
Garthor wrote:
Login()
if(Players==0)
Players = 1
usr << "You are the host!"

You have to define var/global/Players

All things being equal, you're better off with a list than a numerical var. With a list of players, you have more options--you can quickly use it to loop through player mobs, send a message just to players instead of the world, etc.
var/list/players=list()

mob
Login()
..()
players+=src

Logout()
players-=src
..()

Del()
players-=src // just a failsafe in case Logout() doesn't do it
..()

Lummox JR
In response to Alathon
AH, so this is where it went, I THOUGHT someone moved it but uh, isn't this more for the "Coding Problems" forum?
In response to MartialArtistAbu
MartialArtistAbu wrote:
AH, so this is where it went, I THOUGHT someone moved it but uh, isn't this more for the "Coding Problems" forum?

No, because you weren't asking for help debugging existing code.

Lummox JR
In response to Lummox JR
k