Index: code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc
===================================================================
--- code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc	(revision 7586)
+++ code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc	(revision 7596)
@@ -35,5 +35,5 @@
 #include "core/ConfigValueIncludes.h"
 #include "util/Convert.h"
-
+//TODO: respawn delay
 namespace orxonox
 {
@@ -47,4 +47,5 @@
         this->playersAlive=0;
         this->timeRemaining=20.0f;
+        this->respawnDelay=4.0f;
         this->setHUDTemplate("LastmanstandingHUD");
     }
@@ -55,8 +56,24 @@
             if (it->second.state_ == PlayerState::Dead)
             {
-                bool alive = (0<playerLives_[it->first]);
+                bool alive = (0<playerLives_[it->first]&&(inGame_[it->first]));
                 if (alive&&(it->first->isReadyToSpawn() || this->bForceSpawn_))
+                {
                     this->spawnPlayer(it->first);
-             }
+                }
+                else if ((!inGame_[it->first])&&(0<playerLives_[it->first]))
+                {
+                    if (it->first->getClientID()== CLIENTID_UNKNOWN)
+                        return;
+                    const std::string& message = "Respawn in " +multi_cast<std::string>(respawnDelay)+ " seconds." ;
+                    this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
+                }
+                else if (0>=playerLives_[it->first])
+                {
+                    if (it->first->getClientID()== CLIENTID_UNKNOWN)
+                        return;
+                    const std::string& message2 = "You have lost all " +multi_cast<std::string>(lives)+ " lives." ;
+                    this->gtinfo_->sendFadingMessage(message2,it->first->getClientID());
+                }
+            }
     }
 
@@ -66,4 +83,5 @@
         SetConfigValue(lives, 4);
         SetConfigValue(timeRemaining, 20.0f);
+        SetConfigValue(respawnDelay, 4.0f);
     }
 
@@ -82,4 +100,5 @@
             return true;
         playerLives_[victim->getPlayer()]=playerLives_[victim->getPlayer()]-1;
+        this->inGame_[victim->getPlayer()]=false;//if player dies he, isn't allowed to respawn immediately
         if (playerLives_[victim->getPlayer()]<=0)//if player lost all lives
         {
@@ -117,4 +136,6 @@
         this->playersAlive++;
         this->timeToAct_[player]=timeRemaining;
+        this->playerDelayTime_[player]=respawnDelay;
+        this->inGame_[player]=true;
         //Update: EachPlayer's "Players in Game"-HUD
         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
@@ -151,9 +172,12 @@
         if (!player)
             return;
-        this->timeToAct_[player]=timeRemaining+3.0f;//reset timer
+        this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer
+        this->playerDelayTime_[player]=respawnDelay;
         //Update: Individual Players "lifes"-HUD
         std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(player);
         if (it2 != this->players_.end())
         {
+            if (it2->first->getClientID()== CLIENTID_UNKNOWN)
+                return;
             const std::string& message = "Your Lives: " +multi_cast<std::string>(playerLives_[player]);
             this->gtinfo_->sendFadingMessage(message,it2->first->getClientID());
@@ -170,5 +194,5 @@
             if (it->first->getClientID() == CLIENTID_UNKNOWN)
                 continue;
-            const std::string& message1 = "Remaining Players : "+ multi_cast<std::string>(playersAlive);
+            const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
             this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
         }
@@ -196,5 +220,5 @@
                 {return;}
             pawn->kill();
-            this->timeToAct_[player]=timeRemaining+3.0f;//reset timer
+            this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer
         }
     }
@@ -210,17 +234,27 @@
             }
             for (std::map<PlayerInfo*, float>::iterator it = this->timeToAct_.begin(); it != this->timeToAct_.end(); ++it)
-            {        
-                it->second-=dt;
-                if (it->second<timeRemaining/6)//Warning message
-                {
+            {   
+                if (playerGetLives(it->first)<=0)//Players without lives shouldn't be affected by time.
+                    return;     
+                it->second-=dt;//Decreases punishment time.
+                if (!inGame_[it->first])//Manages respawn delay - player is forced to respawn after the delaytime is used up. 
+                {
+                    playerDelayTime_[it->first]-=dt;
+                    if (playerDelayTime_[it->first]<=0)
+                    this->inGame_[it->first]=true;
+                }
+                else if (it->second<0.0f)
+                {
+                    it->second=timeRemaining+3.0f;//reset punishment-timer
+                    if (playerGetLives(it->first)>0)
+                        this->killPlayer(it->first);
+                }
+                else if (it->second<timeRemaining/6)//Warning message
+                {
+                    if (it->first->getClientID()== CLIENTID_UNKNOWN)
+                        return;
                     const std::string& message = "Camper Warning! Don't forget to shoot.";
                     this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
                 }
-                if (it->second<0.0f)
-                {
-                    it->second=timeRemaining+3.0f;//reset timer
-                    if (playerGetLives(it->first)>0)
-                        this->killPlayer(it->first);
-                }
             }
         }
Index: code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h
===================================================================
--- code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h	(revision 7586)
+++ code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h	(revision 7596)
@@ -55,4 +55,7 @@
             float timeRemaining; //!< Each player has a certain time where he or she has to hit an opponent or will be punished.
             std::map<PlayerInfo*, float> timeToAct_; //!< Each player's time till she/he will be punished is stored here.
+            float respawnDelay;
+            std::map<PlayerInfo*, float> playerDelayTime_; //!< Stores each Player's delay time.
+            std::map<PlayerInfo*, bool> inGame_; //!< Indicates each Player's state.
             virtual void spawnDeadPlayersIfRequested(); //!< Prevents dead players to respawn
 
