Jump to content
  • 0
Sign in to follow this  
Eridonis

Occupied Room Instance However.

Question

So I have conditionals going. If a player is in a room, no one can enter until he/she comes out of the occupied room. However if a person phantom logs off, never returns the room is doomed to be locked forever. Does anyone have a solution for this?

- I already have something if the player relogs back into the game. However
- Logging off forever, forever locks the room.

How do I fix this?

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Not perfect, but here's a timed solution: 

 

Set a global variable "Server Time" set on  Sytem Time and a "Lock" Variable

When the player enter the room, set "lock Variable On" and nobody can enter while it's on.

Then the player have (As an exemple) 10 mn to do whatever he have to do in this room.

Set a second Global variable "Lock Timer" wich use the "Server Time" as base and add 600.000Ms to this variable (For 10 mn).

When the "Server Timer" Var is superior or equal to the "Lock Timer" var, set the "Lock" var to off.

The room will be unlocked. If the player need more time you can make a checkbox(When it's approaching the end) for player inside to add time, you can also add monster to kill inside (or lever, or switch, or whatever) to add time to the timer.

 

More explications in this topic too :

 

 

Share this post


Link to post
Share on other sites
  • 0

Basically a timer that resets the variable on the room. 

So if someone is using the room right when the Global timer exhausts another player can enter? 

My instance is where, there are three rooms.
Room 1) One of the player logged off in the room. Nobody can enter that room ever until that player logs in.
Room 2) It works perfectly fine people can come and go and no one logged off on it.
Room 3) Works like room 2.

This is a change room, I don't want people coming in while people are changing. Opening it through a global timed event is out of the option for me. 


Only Option: A perverted bath owner who has the ability to open change rooms. Unless there is a way to prevent logging off while in a change room that would be cool. Or having the variable reset when a person logs off. This is quite difficult lol.


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...