Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Script Plant mg42 (Multi player)
konrad12345678
General Member
Since: Aug 19, 2011
Posts: 9
Last: Feb 12, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Saturday, Dec. 31, 2011 10:36 pm
Hi everyone! I have this script:



Code:
			

                                                              self.turret = spawnTurret( "misc_turret", self.origin, "saw_bipod_prone_mp" );
								self.turret.angles = self.angles;
								self.turret setModel( "mg42_bipod_prone_mp" );
								self.turret setLeftArc( 45 );
								self.turret setRightArc( 45 );
                                self.turret setTopArc( 25 );
								self.turret setBottomArc( 10 );
								self.turret.weaponinfo = "saw_bipod_prone_mp"; 
				

I added precache and model not spawned. Help me please!
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Jan. 1, 2012 09:51 am
Hello konrad12345678 Use this script

Code:
main()
{
 self.mg34hud destroy();
 self.mg34hud = newClientHudElem(self);
 self.mg34hud.alignx = "center";
 self.mg34hud.x = 330;
 self.mg34hud.y = 320; 
 self.mg34hud.fontscale = 1.2;
 self.mg34hud.label = &"^2`^7To Blow up Press [^7F^9]^2`";

 for(;;)
 {
  wait .05;       
  if(self isOnGround() && self useButtonPressed())
  {
   self.mg34hud destroy();
   plantloc=bullettrace(self.origin,self.origin,false,undefined);
  
   level.barrel = spawn("script_model",self.origin);
   level.barrel.angles = (self.angles);
   level.barrel setmodel("xmodel/hill400_barrel_black");

   level.model=spawn("script_model",plantloc["position"]);
   level.model setmodel(level.turrsupportmodel);

   level.mg = spawnTurret ("misc_mg42", (self.origin+(0,0,45)), "mg42_bipod_stand_mp");
   level.mg setmodel("xmodel/weapon_mg42");
   level.mg.angles = (self.angles);   
   level.timemg=60;
   thread lol();
   break;
  }
   
  else if(!self isOnGround() && self useButtonPressed()) 
  {
   self iprintlnbold("^2`^9You Must Be On The Ground to Plant MG42^2`");
   wait 3;
  }  
        
 }
}

lol()
{
  while(1) 
  {
  wait 0.05;
  level.timemg-=0.05;
  if(level.timemg<=0 || self.pers["team"]!="allies")
  {
  level.mg hide();
  level.model hide();
  level.barrel hide();
  level.barrel delete();
  level.mg delete();
  level.model delete();
  break;
  }
  } 
}


I don't know whose it, I simply edited it under myself
precache:
Code:
precacheModel("xmodel/hill400_barrel_black");
precachemodel("xmodel/weapon_mg42");
precacheItem("mg42_bipod_stand_mp");
precacheString(&"^2`^7To Blow up Press [^7F^9]^2`");
Share |
konrad12345678
General Member
Since: Aug 19, 2011
Posts: 9
Last: Feb 12, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Sunday, Jan. 1, 2012 11:14 am
Thanks a lot ! This script is great and you :D
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»