ID:164672
 
How could i make it so whoever is the first player in the world logs in they get special verbs and then whoever logs in after cant get these verbs?

eg:
mob
Login()
//search to see if there is a first player
if(first)
//give the verbs
//assign the variable
else
//i know what to do here


thinking it like this aswell

mob
Login()
for(first in world)//search to see if there is a first player
if(!first)
//give the verbs
//assign the variable
else
//i know what to do here

mob/var/first
Rickoshay wrote:
How could i make it so whoever is the first player in the world logs in they get special verbs and then whoever logs in after cant get these verbs?

eg:
> mob
> Login()
> //search to see if there is a first player
> if(first)
> //give the verbs
> //assign the variable
> else
> //i know what to do here

thinking it like this aswell

Well, you have the right idea

You could use a global variable (that is true for all mobs).

<dm>
mob/var/global/first
mob/Login()
if(!first)
//Do the verb giving
else
//Do whatever you want here


There are probably better ways but I just cannot think right now.
mob
Login()
for(first in world)//search to see if there is a first player
if(!first)
//give the verbs
//assign the variable
else
//i know what to do here

mob/var/first</dm>
In response to Shlaklava
Thanks man, I guess i wasnt to fat off.
var/PlayerCount=0 //Make a variable which will count people as they login
mob/Login()
..()
PlayerCount++ //increase the counter by one
if(PlayerCount==1) //if there's only one person present
src.verbs+= //grant verbs here
else
//do whatever

This is how I did it, which is strikingly similar to the previous suggested solution. There's probably even more efficient ways to do it, but I don't know them.
You want hosts to get verbs? Thats not the best way. If a person logs in before the host, they get the verbs and not the host.
In response to RedlineM203
Thats the whole point its a game based on tig. You know im just making a starter game.
In response to Lyra04
Lyra04 wrote:
There's probably even more efficient ways to do it, but I don't know them.

For one, you could do if(++PlayerCount==1). ;)
In response to Android Data
You could also have them add themselves to a text file to set themselves as hosts and so that they can make additional moderators. But you may run into human issues such as cheating or bribery