Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Check inactivity
- if ((_server._zoneConfig.arena.inactivityTimeout > 0) &&
- (now - player._lastMovement) > (_server._zoneConfig.arena.inactivityTimeout * 1000) &&
- player._lastMovement != 0)
- {
- player.spec();
- player.sendMessage(-1, "You have been sent to spectator mode for being inactive");
- }
- t = getTerrain(player._state.positionX, player._state.positionY);
- //Check maxTimeAllowed inactivity
- if (player._arena.getTerrain(player._state.positionX, player._state.positionY).maxTimeAllowed > 0)
- {
- int maxTime = (player._arena.getTerrain(player._state.positionX, player._state.positionY).maxTimeAllowed * 1000);
- //Send message at half of max time
- if ((now - player._lastMovement) >= (maxTime / 2) && (now - player._lastMovement) <= ((maxTime / 2) + 10) && player._lastMovement != 0)
- {
- string format = "WARNING! Staying in this location for another {0} seconds will send you to spectator mode.";
- player.sendMessage(-1, String.Format(format, ((maxTime / 2) / 1000)));
- }
- //Send to spectator due to inactivity
- //Note: We do the check for over max first
- if ((now - player._lastMovement) > maxTime && player._lastMovement != 0)
- {
- player.spec();
- player.sendMessage(-1, "You have been sent to spectator mode due to inactivity.");
- }
- }
Add Comment
Please, Sign In to add comment