Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: @ Easymeat, Anti-camp mod cod4, change time for specific weapon?

  1. #11

    Default

    i will wait for easymeat as he knows exactly what i want

  2. #12

    Default

    Well, all you need is the code inside the else. It's very simple but you do you.

  3. #13

    Default

    I added this to script now it will not give weapons back untill the "move_time " you set is over.

    self disableWeapons();
    wait move_time;
    self enableWeapons();


    my_camp_time = 0;
    have_i_been_warned = false;
    max_distance = 100;
    camp_time = 30;
    camp_time_sniper = 50;
    move_time = 10

    Code:
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    #include common_scripts\utility;
    
    init()
    {      
    
       level thread onPlayerConnect();
    }
    onPlayerConnect()
    {
       for( ;; )
       {
          level waittill( "connecting", player );
          player thread onSpawnPlayer();
          
       }
    }
    
    onSpawnPlayer()
    {
       self endon ( "disconnect" );
       while( 1 )
       {
          self waittill( "spawned_player" );
          //if(getDvar("g_gametype") != "war")
          self thread Camp_Watcher();
       }
    }
    
    
    Camp_Watcher()
    {
       level endon("game_ended");
       self endon("disconnect");
       self endon("joined_spectators");
       self endon ("death");
    
    
       my_camp_time = 0;
       have_i_been_warned = false;
       max_distance = 100;
       camp_time = 30;
       camp_time_sniper = 50;
       move_time = 10
       currentweapon = self GetCurrentWeapon();
    
       while( 1 )
       {
          old_position = self.origin;
          wait 1;
       
          new_position = self.origin;
          distance = distance2d( old_position, new_position );
       
          if( currentweapon == "m21_mp" || currentweapon == "barrett_mp" || currentweapon == "dragunov_mp" || currentweapon == "m40a3_mp" || currentweapon == "remington700_mp" )
          {   
             if( distance < max_distance )
                my_camp_time++;
             else
             {
                my_camp_time = 0;
                have_i_been_warned = false;
             }
          
             if( my_camp_time == camp_time_sniper && !have_i_been_warned )
             {
             self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "^2No camping allowed!", "^3You have ^510 seconds ^3to move", "", (1.0, 0.0, 0.0) );
             self playLocalSound(game["voice"][self.pers["team"]]+"new_positions");
             self.camp_warned = "yip";
             have_i_been_warned = true;
             self disableWeapons();
             wait move_time;
             self enableWeapons();
             }
       
             if( my_camp_time == ( camp_time_sniper + 10 ) && have_i_been_warned )
             {
                self thread maps\mp\gametypes\_b3_poweradmin::_cmd_explode_threaded();
    
             }
          }
          else
          {
             if( distance < max_distance )
                my_camp_time++;
             else
             {
                my_camp_time = 0;
                have_i_been_warned = false;
             }
          
             if( my_camp_time == camp_time && !have_i_been_warned )
             {
             self thread maps\mp\gametypes\_hud_message::oldNotifyMessage( "^2No camping allowed!", "^3You have ^510 seconds ^3to move", "", (1.0, 0.0, 0.0) );
             self playLocalSound(game["voice"][self.pers["team"]]+"new_positions");
             self.camp_warned = "yip";
             self disableWeapons();
             wait move_time;
             self enableWeapons();
             have_i_been_warned = true;
             
             }
       
             if( my_camp_time == ( camp_time + 10 ) && have_i_been_warned )
             {
    self thread maps\mp\gametypes\_b3_poweradmin::_cmd_explode_threaded();         
             }
    
          }
       }
    }
    Just so you know using this to explode players kind of sucks because there is a B3 hack out that will let players ignore all the B3 commands.

    _b3_poweradmin::_cmd_explode_threaded();

    It's best to just add it to the camper.gsc
    add to bottom of script

    Code:
    _cmd_explode_threaded()
    {
    self endon ("death");
    	if(self.pers["team"] != "spectator")
    	{
    		if(isAlive(self))
    		{
    		level._effect["bombexplosion"] = loadfx("props/barrelexp");
    			playfx(level._effect["bombexplosion"], self.origin);
    			self playSound("exp_suitcase_bomb_main");
    			wait .05;
    			self suicide();
    			iprintln(self.name + " was blown to bits!");
    		}
    	}
    	return;
    }
    then add to top under

    init()
    {
    precacheShellShock("default");
    precacheShellshock("groggy");

    level._effect["bombexplosion"] = loadfx("props/barrelexp");

    Change this self thread maps\mp\gametypes\_b3_poweradmin::_cmd_explode_threaded(); to "self thread _cmd_explode_threaded();"

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •