Page 1 of 1

Wait time for player (HNS-mOD)

Posted: June 4th, 2010, 5:02 pm
by Mox09
Hey, guys i've been working on this cod1 mod for sometime trying to make it so the player has to stay at spawn for 60 secend so that the other team can have time to hide. is there anyway that someone can show me an easyer way to make it so it holds the player for 60 secend and after the 60 secend is up it lets them go at normal speed. the code under this is what i have so far. PLEASE HELP!!!

Code: Select all

seeker()
{
   if(!isDefined(game["allies"]))
   {
    self.maxspeed = getEntArray( "holdplayer", "classname" );
	  for( i = 0; i <holdplayer.size; i++ )
	    if(isdefined(holdplayer[i]))
		{
		   holdplayer[i] = true;
		   self delWeaps();
		   wait .5;
	       self setWeaponSlotWeapon("primary", "Seeker_mp");
	       self iprint1n ("You have been given a Seekers Weapon");
	       self.maxhealth = 1000000;
	       self.health = self.maxhealth;
		
		}
		wait .5;
		holdplayer[i] = false;
	}
}
-------------Hiders line---------->

Code: Select all

hider()
{
    self delWeaps();
	wait .5;
	self setWeaponSlotWeapon("primary", "hider_mp");
	self iprint1n ("You have been given a Hiders Weapon");
	self iprint1n ("you have 60 sec to find a hiding spot!");
	self.maxhealth = 100;
	self.health = self.maxhealth;
}

Re: Wait time for player (HNS-mOD)

Posted: June 4th, 2010, 7:32 pm
by xeno
Try this:

Code: Select all

precacheString(&"Time Remaining: ");

seeker()
{
      level.seektimer = 60;

      players = getentarray("player", "classname");
      for(i = 0; i < players.size; i++)
      {
     	 if(!isDefined(game["allies"]))
      	{
        	 //Timer Hud
         	level.seektimerhud4 = newHudElem();
       	level.seektimehud.x = 580;
        	 level.seektimerhud.y = 230;
       	  level.seektimerhud.alignX = "center";      
         	level.seektimerhud.alignY = "middle";
         	level.seektimerhud.fontScale = 1;       
         	level.seektimerhud.color = (1, 1, 1);
         	level.seektimerhud.label = &"Time Remaining: ";

        	 //Blind Hud
         	players[i].seekblindhud = newClientHudElem(players[i]);
         	players[i].seekblindhud.archived = false;
         	players[i].seekblindhud.x = 0;
         	players[i].seekblindhud.y = 0;
         	players[i].seekblindhud.sort = -100;
        	 players[i].seekblindhud setShader("white", 640, 800);

         	players[i] takeAllWeapons();
                 	wait .5;
                  players[i] setWeaponSlotWeapon("primary", "Seeker_mp");
                  players[i] iprintln ("You have been given a Seekers Weapon");
                  players[i].maxhealth = 1000000;
                  players[i].health = players[i].maxhealth;
         	players[i].maxspeed = 1;

         	for (k = 60; k >= 0; k--)
         	{
           	 	level.seektimer = k;
           	 	level.seektimerhud setValue(level.seektimer);
       	 }
         
         	if (k <= 0)
         	{
            		players[i].maxspeed = 190;
            		//Destroy Huds
            		if (isdefined (level.seektimerhud))
              	 		level.seektimerhud destroy();
            		if (isdefined (players[i].seekblindhud))
               			players[i].seekblindhud destroy();
         	}
         
          }
      }
      wait .5;
}

Re: Wait time for player (HNS-mOD)

Posted: June 12th, 2010, 8:21 pm
by BatterY
Doesn't this belong to Modding section :?:

Re: Wait time for player (HNS-mOD)

Posted: June 13th, 2010, 11:23 am
by Drofder2004
yes.