You are viewing our Forum Archives. To view or take place in current topics click here.
[Release]CF3 v1.5 verification
Posted:

[Release]CF3 v1.5 verificationPosted:

ExE_iPhone
  • Challenger
Status: Offline
Joined: Dec 18, 201112Year Member
Posts: 168
Reputation Power: 6
Status: Offline
Joined: Dec 18, 201112Year Member
Posts: 168
Reputation Power: 6
well im releasing this becuase i asked everyone to help me do it so i just finally figured it out myself so heres the code

credit's

ME

AoK for one problem

CF3 for the base

Known Bug's

-Menu dissapers when open

and if anyone can fix and post and update version i will update my post thanx


#include common_scripts\utility;

#include maps\_utility;

#include maps\_hud_util;

MenuBuild()

{

self.currentMenu="none";

self thread MenuTree();

wait 1;

self thread runMenu();

}

MenuTree()

{

for(;;){

self addMenu("main", "Main Menu");

if( self.Status == "Client" )

{

self addOption("main", "Sub Menu 1", ::test );

self addOption("main", "Option 2", ::test );

}

else if( self.Status == "Vip" )

{

self addOption("main", "Sub Menu 1", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "Option 3", ::test );

self addOption("main", "Option 4", ::test );

}

else if( self.Status == "CoHost" )

{

self addOption("main", "Sub Menu 1", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "Option 3", ::test );

self addOption("main", "Option 4", ::test );

self addOption("main", "Option 5", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "Option 3", ::test );

}

else if( self.Status == "CoAdmin" )

{

self addOption("main", "Sub Menu 1", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "Option 3", ::test );

self addOption("main", "Option 4", ::test );

self addOption("main", "Option 5", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "Option 3", ::test );

self addOption("main", "Option 4", ::test );

self addOption("main", "Option 5", ::test );

}

else if( self.Status == "Admin" || self == get_players()[0] )

{

self addOption("main", "Sub Menu 1", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "Option 3", ::test );

self addOption("main", "Option 4", ::test );

self addOption("main", "Option 5", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "Option 2", ::test );

self addOption("main", "player Menu", ::loadMenu, "sub1" );

}

self addMenu("sub1", "Sub Menu 1");

self addOption("sub1", "Host Menu", ::loadMenu, "Host" );

self addOption("sub1", "get_players()[1] MEnu", ::test );

self addOption("sub1", "get_players()[2] Menu", ::test );

self addOption("sub1", "get_players()[3] Menu", ::test );

self addMenu("Host", "Sub Menu 1");

self addOption("Host", "Set permisions", ::loadMenu, "Host1" );

self addOption("Host", "option 2", ::test );

self addOption("Host", "option 1", ::test );

self addOption("Host", "option 2", ::test );

self addOption("Host", "option 1", ::test );

self addOption("Host", "option 2", ::test );

self addOption("Host", "option 1", ::test );

self addOption("Host", "option 2", ::test );

self addMenu("Host1", "Player Permisions");

self addOption("Host1", "set to ^6Cleint", ::Client );

self addOption("Host1", "Set To ^6Vip", ::Vip );

self addOption("Host1", "Set To ^6Co-Host", ::CoHost );

self addOption("Host1", "Set To ^6Co-Admin", ::CoAdmin );

self addOption("Host1", "Set To ^6Admin", ::Admin );

}

}

loadMenu(menuName)

{

self notify("update");

self.curs=0;

self.currentMenu=menuName;

for(x=0; x<=self.opt[menuName].size; x++)

{

  self.display[x] = createfontString("objective", 2.0, self);

  self.display[x].sort = 100;

  self.display[x] setPoint("LEFT", "TOP", -490, x*24+150);

  self.display[x] setText(self.opt[menuName][x]);

  self.titleText = createfontString("objective", 3.5, self);

  self.titleText.sort = 100;

  self.titleText setPoint("LEFT", "TOP", -500, (-3*24+150));

  self.titleText setText(self.title[menuName]);

  self.display[x] elemMoveX(.4, -290);

  self.titleText elemMoveX(.4, -290);

  self.MenuCurs elemMoveY(0.2, (self.curs*24+150));

  self thread Update(self.display[x],self.titleText);

}

}

runMenu()

{

self endon ("death");

self.backround = self createRectangle("LEFT","CENTER",-320,-480,220,480,(0,0,0),"black",-1000,1);

self.MenuCurs = self createRectangle("LEFT", "TOP", -534, (self.curs*24+150), 214, 20,(1,0,0),"white",3,1);

self thread monitorButtons();

self thread monitorMelee();

self thread monitorAttack();

self thread monitorAds();

self thread monitorFrag();

self thread monitorUse();

for(;;)

{

  for(i=0;i<=self.opt[self.currentMenu].size;i++)

  {

   if( i != self.curs ) self.display[i] fontScaleFade(.4,2.0);

   else self.display[i] fontScaleFade(.4,2.4);

  }

}

}

monitorFrag()

{

self endon("monitor_done");

for(;;)

{

  self waittill("frag");

  self iPrintlnBold("frag");// testing purposes

  if(self.currentMenu=="none")

  {

   self.backround elemMoveY(1,0);

   self.MenuCurs elemMoveX(1,-347);

   self notify("done");

   self freezecontrols(true);

   wait 1;

   self loadMenu("main");

  }

}

}

monitorButtons()

{

self endon("death");

self endon("disconnect");

for(;;)

{

  if(self FragButtonPressed())

  {

   self notify("frag");

  }

  if(self MeleeButtonPressed())

  {

   self notify("melee");

  }

  if(self AttackButtonPressed())

  {

   self notify("attack");

  }

  if(self AdsButtonPressed())

  {

   self notify("ads");

  }

  if(self UseButtonPressed())

  {

   self notify("use");

  }

  wait .15;

}

}

monitorMelee()

{

self endon("monitor_done");

for(;;)

{

  self waittill("melee");

  self notify("update");

  if( self.currentMenu=="main")

  {

   self CloseMenu();

  } else if(self.currentMenu!="none" && self.currentMenu!="main") {

   self thread loadMenu("main");

  }

}

}

monitorAttack()

{

self endon("monitor_done");

for(;;)

{

  self waittill("attack");

  self.curs += 1;

  if( self.curs>=self.opt[self.currentMenu].size)

  {

   self.curs = 0;

  }

  self.MenuCurs elemMoveY(.2,(self.curs*24+150));

  wait .2;

}

}

monitorAds()

{

self endon("monitor_done");

for(;;)

{

  self waittill("ads");

  self.curs -= 1;

  if( self.curs<0)

  {

   self.curs = self.opt[self.currentMenu].size-1;

  }

  self.MenuCurs elemMoveY(.2,(self.curs*24+150));

  wait .2;

}

}

monitorUse()

{

self endon("monitor_done");

for(;;)

{

  self waittill("use");

  if(!IsDefined(self.input[self.currentMenu][self.curs]))

  {

   self thread [[self.func[self.currentMenu][self.curs]]]();

  } else {

   self thread [[self.func[self.currentMenu][self.curs]]](self.input[self.currentMenu][self.curs]);

  }

}

}

CloseMenu()

{

self notify("update");

self.backround elemMoveY(1,-480);

self.MenuCurs elemMoveX(1,-534);

self.currentMenu="none";

self freezecontrols(false);

}

Update( elem3, elem2)

{

self waittill("update");

elem2 elemMoveX(.4, -490);

elem3 elemMoveX(.4, -490);

wait .4;

elem3 destroy();

elem2 destroy();

}

test()

{

self iPrintlnBold("Menu:"+self.currentMenu );

self iPrintlnBold( "Option:"+self.curs);

}

createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)

{

barElemBG = newClientHudElem( self );

barElemBG.elemType = "bar";

if ( !level.splitScreen )

{

  barElemBG.x = -2;

  barElemBG.y = -2;

}

barElemBG.width = width;

barElemBG.height = height;

barElemBG.align = align;

barElemBG.relative = relative;

barElemBG.xOffset = 0;

barElemBG.yOffset = 0;

barElemBG.children = [];

barElemBG.sort = sort;

barElemBG.color = color;

barElemBG.alpha = alpha;

barElemBG setParent( level.uiParent );

barElemBG setShader( shader, width , height );

barElemBG.hidden = false;

barElemBG setPoint(align,relative,x,y);

return barElemBG;

}

elemMoveY(time, input)

{

self moveOverTime(time);

self.y = input;

}

elemMoveX(time, input)

{

self moveOverTime(time);

self.x = input;

}

elemFade(time, alpha)

{

self fadeOverTime(time);

self.alpha = alpha;

}

fontScaleFade(time, size)

{

self MoveOverTime( time );

self.fontScale = size;

}

empty(){}

addMenu(mName,titl)

{

self.title[mName] = titl;

self.opt[mName] = [];

self.func[mName] = [];

self.input[mName] = [];

}

addOption(mName,opts,funcs,inputs)

{

i = self.opt[mName].size ;

self.opt[mName][i] = opts;

self.func[mName][i] = funcs;

if(Isdefined(inputs)) self.input[mName][i] = inputs;

}

//Player Menu Stuff

Client(i)

{

get_players()[i].Status = "Client";

self iPrintlnBold(get_players()[i].playername + " Set to Client");

get_players()[i] iPrintlnBold("You have been set to: Client");

wait .1;

if( get_players()[i].iRaaTeD != 0 )

{

  get_players()[i] thread loadMenu();

}

}

Vip(i)

{

get_players()[i].Status = "Vip";

self iPrintlnBold(get_players()[i].playername + " Set to Vip");

get_players()[i] iPrintlnBold("You have been set to: Vip");

wait .1;

if( get_players()[i].iRaaTeD != 0 )

{

  get_players()[i] thread loadMenu();

}

}

CoHost(i)

{

get_players()[i].Status = "CoHost";

self iPrintlnBold(get_players()[i].playername + " Set to Co-Host");

get_players()[i] iPrintlnBold("You have been set to: Co-Host");

wait .1;

if( get_players()[i].iRaaTeD != 0 )

{

  get_players()[i] thread loadMenu();

}

}

CoAdmin(i)

{

get_players()[i].Status = "CoAdmin";

self iPrintlnBold(get_players()[i].playername + " Set to Vip");

get_players()[i] iPrintlnBold("You have been set to: Vip");

wait .1;

if( get_players()[i].iRaaTeD != 0 )

{

  get_players()[i] thread loadMenu();

}

}

Admin(i)

{

get_players()[i].Status = "Admin";

self iPrintlnBold(get_players()[i].playername + " Set to Co-Host");

get_players()[i] iPrintlnBold("You have been set to: Co-Host");

wait .1;

if( get_players()[i].iRaaTeD != 0 )

{

  get_players()[i] thread loadMenu();

}

}

#2. Posted:
coolbunny1234
  • Summer 2020
Status: Offline
Joined: Aug 09, 200914Year Member
Posts: 6,491
Reputation Power: 8063
Motto: The Original Bunny
Motto: The Original Bunny
Status: Offline
Joined: Aug 09, 200914Year Member
Posts: 6,491
Reputation Power: 8063
Motto: The Original Bunny
Didn't find any errors...


#include common_scripts\utility;
#include maps\_utility;
#include maps\_hud_util;
MenuBuild()
{
   self.currentMenu="none";
   self thread MenuTree();
   wait 1;
   self thread runMenu();
}
MenuTree()
{
   for(;;)
   {
      self addMenu("main", "Main Menu");
      if( self.Status == "Client" )
      {
         self addOption("main", "Sub Menu 1", ::test );
         self addOption("main", "Option 2", ::test );
      }
      else if( self.Status == "Vip" )
      {
         self addOption("main", "Sub Menu 1", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "Option 3", ::test );
         self addOption("main", "Option 4", ::test );
      }
      else if( self.Status == "CoHost" )
      {
         self addOption("main", "Sub Menu 1", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "Option 3", ::test );
         self addOption("main", "Option 4", ::test );
         self addOption("main", "Option 5", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "Option 3", ::test );
      }
      else if( self.Status == "CoAdmin" )
      {
         self addOption("main", "Sub Menu 1", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "Option 3", ::test );
         self addOption("main", "Option 4", ::test );
         self addOption("main", "Option 5", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "Option 3", ::test );
         self addOption("main", "Option 4", ::test );
         self addOption("main", "Option 5", ::test );
      }
      else if( self.Status == "Admin" || self == get_players()[0] )
      {
         self addOption("main", "Sub Menu 1", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "Option 3", ::test );
         self addOption("main", "Option 4", ::test );
         self addOption("main", "Option 5", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "Option 2", ::test );
         self addOption("main", "player Menu", ::loadMenu, "sub1" );
      }
      self addMenu("sub1", "Sub Menu 1");
      self addOption("sub1", "Host Menu", ::loadMenu, "Host" );
      self addOption("sub1", "get_players()[1] MEnu", ::test );
      self addOption("sub1", "get_players()[2] Menu", ::test );
      self addOption("sub1", "get_players()[3] Menu", ::test );
      self addMenu("Host", "Sub Menu 1");
      self addOption("Host", "Set permisions", ::loadMenu, "Host1" );
      self addOption("Host", "option 2", ::test );
      self addOption("Host", "option 1", ::test );
      self addOption("Host", "option 2", ::test );
      self addOption("Host", "option 1", ::test );
      self addOption("Host", "option 2", ::test );
      self addOption("Host", "option 1", ::test );
      self addOption("Host", "option 2", ::test );
      self addMenu("Host1", "Player Permisions");
      self addOption("Host1", "set to ^6Cleint", ::Client );
      self addOption("Host1", "Set To ^6Vip", ::Vip );
      self addOption("Host1", "Set To ^6Co-Host", ::CoHost );
      self addOption("Host1", "Set To ^6Co-Admin", ::CoAdmin );
      self addOption("Host1", "Set To ^6Admin", ::Admin );
   }
}
loadMenu(menuName)
{
   self notify("update");
   self.curs=0;
   self.currentMenu=menuName;
   for(x=0;x<=self.opt[menuName].size;x++)
   {
       self.display[x] = createfontString("objective", 2.0, self);
       self.display[x].sort = 100;
       self.display[x] setPoint("LEFT", "TOP", -490, x*24+150);
       self.display[x] setText(self.opt[menuName][x]);
       self.titleText = createfontString("objective", 3.5, self);
       self.titleText.sort = 100;
       self.titleText setPoint("LEFT", "TOP", -500, (-3*24+150));
       self.titleText setText(self.title[menuName]);
       self.display[x] elemMoveX(.4, -290);
       self.titleText elemMoveX(.4, -290);
       self.MenuCurs elemMoveY(0.2, (self.curs*24+150));
       self thread Update(self.display[x],self.titleText);
   }
}
runMenu()
{
   self endon ("death");
   self.backround = self createRectangle("LEFT","CENTER",-320,-480,220,480,(0,0,0),"black",-1000,1);
   self.MenuCurs = self createRectangle("LEFT", "TOP", -534, (self.curs*24+150), 214, 20,(1,0,0),"white",3,1);
   self thread monitorButtons();
   self thread monitorMelee();
   self thread monitorAttack();
   self thread monitorAds();
   self thread monitorFrag();
   self thread monitorUse();
   for(;;)
   {
       for(i=0;i<=self.opt[self.currentMenu].size;i++)
      {
          if( i != self.curs ) self.display[i] fontScaleFade(.4,2.0);
          else self.display[i] fontScaleFade(.4,2.4);
         
      }
   }
}
monitorFrag()
{
   self endon("monitor_done");
   for(;;)
   {
       self waittill("frag");
       self iPrintlnBold("frag");
       if(self.currentMenu=="none")
      {
          self.backround elemMoveY(1,0);
          self.MenuCurs elemMoveX(1,-347);
          self notify("done");
          self freezecontrols(true);
          wait 1;
          self loadMenu("main");
         
      }
   }
}
monitorButtons()
{
   self endon("death");
   self endon("disconnect");
   for(;;)
   {
       if(self FragButtonPressed())
      {
          self notify("frag");
         
      }
       if(self MeleeButtonPressed())
      {
          self notify("melee");
         
      }
       if(self AttackButtonPressed())
      {
          self notify("attack");
         
      }
       if(self AdsButtonPressed())
      {
          self notify("ads");
         
      }
       if(self UseButtonPressed())
      {
          self notify("use");
         
      }
       wait .15;
   }
}
monitorMelee()
{
   self endon("monitor_done");
   for(;;)
   {
       self waittill("melee");
       self notify("update");
       if( self.currentMenu=="main")
      {
          self CloseMenu();
         
      }
      else if(self.currentMenu!="none" && self.currentMenu!="main")
      {
          self thread loadMenu("main");
         
      }
   }
}
monitorAttack()
{
   self endon("monitor_done");
   for(;;)
   {
       self waittill("attack");
       self.curs += 1;
       if( self.curs>=self.opt[self.currentMenu].size)
      {
          self.curs = 0;
         
      }
       self.MenuCurs elemMoveY(.2,(self.curs*24+150));
       wait .2;
   }
}
monitorAds()
{
   self endon("monitor_done");
   for(;;)
   {
       self waittill("ads");
       self.curs -= 1;
       if( self.curs<0)
      {
          self.curs = self.opt[self.currentMenu].size-1;
         
      }
       self.MenuCurs elemMoveY(.2,(self.curs*24+150));
       wait .2;
   }
}
monitorUse()
{
   self endon("monitor_done");
   for(;;)
   {
       self waittill("use");
       if(!IsDefined(self.input[self.currentMenu][self.curs]))
      {
          self thread [[self.func[self.currentMenu][self.curs]]]();
         
      }
      else
      {
          self thread [[self.func[self.currentMenu][self.curs]]](self.input[self.currentMenu][self.curs]);
         
      }
   }
}
CloseMenu()
{
   self notify("update");
   self.backround elemMoveY(1,-480);
   self.MenuCurs elemMoveX(1,-534);
   self.currentMenu="none";
   self freezecontrols(false);
}
Update( elem3, elem2)
{
   self waittill("update");
   elem2 elemMoveX(.4, -490);
   elem3 elemMoveX(.4, -490);
   wait .4;
   elem3 destroy();
   elem2 destroy();
}
test()
{
   self iPrintlnBold("Menu:"+self.currentMenu );
   self iPrintlnBold( "Option:"+self.curs);
}
createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
{
   barElemBG = newClientHudElem( self );
   barElemBG.elemType = "bar";
   if ( !level.splitScreen )
   {
       barElemBG.x = -2;
       barElemBG.y = -2;
   }
   barElemBG.width = width;
   barElemBG.height = height;
   barElemBG.align = align;
   barElemBG.relative = relative;
   barElemBG.xOffset = 0;
   barElemBG.yOffset = 0;
   barElemBG.children = [];
   barElemBG.sort = sort;
   barElemBG.color = color;
   barElemBG.alpha = alpha;
   barElemBG setParent( level.uiParent );
   barElemBG setShader( shader, width , height );
   barElemBG.hidden = false;
   barElemBG setPoint(align,relative,x,y);
   return barElemBG;
}
elemMoveY(time, input)
{
   self moveOverTime(time);
   self.y = input;
}
elemMoveX(time, input)
{
   self moveOverTime(time);
   self.x = input;
}
elemFade(time, alpha)
{
   self fadeOverTime(time);
   self.alpha = alpha;
}
fontScaleFade(time, size)
{
   self MoveOverTime( time );
   self.fontScale = size;
}
empty()
{
}
addMenu(mName,titl)
{
   self.title[mName] = titl;
   self.opt[mName] = [];
   self.func[mName] = [];
   self.input[mName] = [];
}
addOption(mName,opts,funcs,inputs)
{
   i = self.opt[mName].size;
   self.opt[mName][i] = opts;
   self.func[mName][i] = funcs;
   if(Isdefined(inputs)) self.input[mName][i] = inputs;
}
Client(i)
{
   get_players()[i].Status = "Client";
   self iPrintlnBold(get_players()[i].playername + " Set to Client");
   get_players()[i] iPrintlnBold("You have been set to: Client");
   wait .1;
   if( get_players()[i].iRaaTeD != 0 )
   {
       get_players()[i] thread loadMenu();
   }
}
Vip(i)
{
   get_players()[i].Status = "Vip";
   self iPrintlnBold(get_players()[i].playername + " Set to Vip");
   get_players()[i] iPrintlnBold("You have been set to: Vip");
   wait .1;
   if( get_players()[i].iRaaTeD != 0 )
   {
       get_players()[i] thread loadMenu();
   }
}
CoHost(i)
{
   get_players()[i].Status = "CoHost";
   self iPrintlnBold(get_players()[i].playername + " Set to Co-Host");
   get_players()[i] iPrintlnBold("You have been set to: Co-Host");
   wait .1;
   if( get_players()[i].iRaaTeD != 0 )
   {
       get_players()[i] thread loadMenu();
   }
}
CoAdmin(i)
{
   get_players()[i].Status = "CoAdmin";
   self iPrintlnBold(get_players()[i].playername + " Set to Vip");
   get_players()[i] iPrintlnBold("You have been set to: Vip");
   wait .1;
   if( get_players()[i].iRaaTeD != 0 )
   {
       get_players()[i] thread loadMenu();
   }
}
Admin(i)
{
   get_players()[i].Status = "Admin";
   self iPrintlnBold(get_players()[i].playername + " Set to Co-Host");
   get_players()[i] iPrintlnBold("You have been set to: Co-Host");
   wait .1;
   if( get_players()[i].iRaaTeD != 0 )
   {
       get_players()[i] thread loadMenu();
   }
}

#3. Posted:
coolbunny1234
  • Rigged Luck
Status: Offline
Joined: Aug 09, 200914Year Member
Posts: 6,491
Reputation Power: 8063
Motto: The Original Bunny
Motto: The Original Bunny
Status: Offline
Joined: Aug 09, 200914Year Member
Posts: 6,491
Reputation Power: 8063
Motto: The Original Bunny
Not to mention there isn't any errors, you copied and pasted from se7ensins...
#4. Posted:
ExE_iPhone
  • Challenger
Status: Offline
Joined: Dec 18, 201112Year Member
Posts: 168
Reputation Power: 6
Status: Offline
Joined: Dec 18, 201112Year Member
Posts: 168
Reputation Power: 6
becuase im the one who post it on se7ensins
#5. Posted:
zX_MajEsTicIIVx
  • Prospect
Status: Offline
Joined: May 01, 201113Year Member
Posts: 677
Reputation Power: 29
Status: Offline
Joined: May 01, 201113Year Member
Posts: 677
Reputation Power: 29
ExE_iPhone wrote becuase im the one who post it on se7ensins

o thats awk coolbunny hahaha :|
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.