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

Members Online

»
0 Active | 87 Guests
Online:

LATEST FORUM THREADS

»
run artillery on maps
CoD+UO Map + Mod Releases
Call of DutyŽ: WWII
CoD WW2 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 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Script redone
S3NiC
General Member
Since: Aug 13, 2009
Posts: 71
Last: Feb 1, 2010
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Friday, Oct. 23, 2009 07:10 pm
Hey guys i dont know all that much about scripting and i was wondering if this script that i got from http://wiki.modsrepository.com/index.php/Call_of_Duty_4:_Elevator_Brushes is to long.

Code:
main()
{
  level.elevDown=true;
  level.elevMove=false;
  switchTOP=getentarray("ups","targetname");
  for(i=0; i<switchTOP.size; i++)
   switchTOP[i] thread elev_think();
}

elev_think()
{
  IdoorLEFT=getent("leftindoor", "targetname");
  IdoorRIGHT=getent("rightindoor", "targetname");
  OdoorTL=getent("topleftdoor", "targetname");
  OdoorTR=getent("toprightdoor", "targetname");
  OdoorBL=getent("bottomleftdoor", "targetname");
  OdoorBR=getent("bottomrightdoor", "targetname");
  thread door_open(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR);
  while(1)
  {
   self waittill ("trigger");
   if(level.elevMove==false)
    {
     level.elevMove=true;
     thread elev_move();
    }
  }
}

elev_move()
{
  etime=5;
  zdirec="z";
  zdist1=440;
  zdist2=-440;
  IdoorLEFT=getent("leftindoor", "targetname");
  IdoorRIGHT=getent("rightindoor", "targetname");
  OdoorTL=getent("topleftdoor", "targetname");
  OdoorTR=getent("toprightdoor", "targetname");
  OdoorBL=getent("bottomleftdoor", "targetname");
  OdoorBR=getent("bottomrightdoor", "targetname");
  Elevator=getent("elevator", "targetname");
  if(level.elevDown==true)
   {
    door_close(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR);
    wait(.1);
    Elevator thread move_func(zdist1, etime, zdirec);
    IdoorLEFT thread move_func(zdist1, etime, zdirec);
    IdoorRIGHT thread move_func(zdist1, etime, zdirec);
    Elevator waittill ("movedone");
    door_open(IdoorLEFT, IdoorRIGHT, OdoorTL, OdoorTR);
    level.elevDown=false;
    level.elevMove=false;
   }
  else
  {
   door_close(IdoorLEFT, IdoorRIGHT, OdoorTL, OdoorTR);
   wait(.1);
   Elevator thread move_func(zdist2, etime, zdirec);
   IdoorLEFT thread move_func(zdist2, etime, zdirec);
   IdoorRIGHT thread move_func(zdist2, etime, zdirec);
   Elevator waittill ("movedone");
   door_open(IdoorLEFT, IdoorRIGHT, OdoorBL, OdoorBR);
   level.elevDown=true;
   level.elevMove=false;
  }
  wait(.1);
}

door_close(leftIN, rightIN, leftOUT, rightOUT)
{
  LDclose=41;
  RDclose=-41;	
  ydirec="x";
  dtime=1.1;
  leftIN thread move_func(LDclose,dtime, ydirec);
  rightIN thread move_func(RDclose,dtime, ydirec);
  wait(1);
  leftOUT thread move_func(LDclose,dtime, ydirec);
  rightOUT thread move_func(RDclose,dtime, ydirec);
  wait(1);
 }

door_open(leftyIN, rightyIN, leftyOUT, rightyOUT)
{
  LDopen=-41;
  RDopen=41;
  ydirec="x";
  dtime=1.1;
  leftyOUT thread move_func(LDopen,dtime, ydirec);
  rightyOUT thread move_func(RDopen,dtime, ydirec);
  wait(1);
  leftyIN thread move_func(LDopen,dtime, ydirec);
  rightyIN thread move_func(RDopen,dtime, ydirec);
 }

move_func(dist,time,direc)
{
  if(direc=="z")
  self movez (dist, time, (time/2), (time/2));
  if(direc=="x")
   self movex (dist, time, (time/2), (time/2));
   self waittill ("movedone");
}


If it is could someone please shorten it for me? Oh yeah and i got the simple elevator to work fine i just want the one with doors. to me the tutorial is badly writen. So if you could help me with that or point me in the right derection.

Thanks,

S3NiC

edited on Oct. 23, 2009 10:10 pm by S3NiC
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

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

»