what iv noticed is after i get past the first menu, the following menus afterwords seem to stop. sometimes ill get them to print, but then the actions that go along with them don't work. actually i was sure i had it working for a second but i tested the same menu for the other team and it didnt work for that specific team. iv tried avoiding asking for help. but i just cant seem to figure it out.
anyways it should still resemble a centerprint menu.
here's what i got so far, can anyone take a peek??
Code: Select all
void() Menu_Update =
// menu navigation every menu display has its own number. check menus.
{
if (self.button2_lastframe)
{
// still pressed this frame
if (self.button2)
{
self.button2_lastframe = TRUE;
return;
}
else
{
// not pressed this frame, clear, allow through
self.button2_lastframe = FALSE;
}
}
self.button2_lastframe = self.button2; // bleh
if (!self.button2)
return;
{
self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
if (self.menu == 1 && self.button2)
{
self.menu = 2;
self.button2 = 0;
return;
}
else if (self.menu == 2 && self.button2)
{
self.menu = 1;
self.button2 = 0;
return;
}
else if (self.menu == 3 && self.button2)
{
self.menu = 4;
self.button2 = 0;
return;
}
else if (self.menu == 4 && self.button2)
{
self.menu = 5;
self.button2 = 0;
return;
}
else if (self.menu == 5 && self.button2)
{
self.menu = 3;
self.button2 = 0;
return;
}
}
self.button2 = 0;
return;
};
void() Menu_Select =
{
// button0 was pressed last frame
if (self.button0_lastframe)
{
// still pressed this frame
if (self.button0)
{
self.button0_lastframe = TRUE;
return;
}
else
{
// not pressed this frame, clear, allow through
self.button0_lastframe = FALSE;
}
}
self.button0_lastframe = self.button0; // bleh
if (!self.button0)
return;
//bprint("Menu_Select: reached\n");
if (self.menu == 1 && self.button0)
{
self.menu = 3;
//self.pteam = 1;
PutAlliedInServer();
}
if (self.menu == 2 && self.button0)
{
self.menu = 3;
//self.pteam = 2;
PutAxisInServer();
}
else if (self.menu == 3 && self.button0)
{
self.pclass = 1;
self.menu = 0;
}
else if (self.menu == 4 && self.button0)
{
self.pclass = 2;
self.menu = 0;
}
else if (self.menu == 5 && self.button0)
{
self.pclass = 3;
self.menu = 0;
}
//self.button0 = 0;
};
void() Menus =
{
if (self.menu == 0)
return;
else
if (self.menu == 1)
{
centerprint(self,"Select a Team\n>Allied\n Axis\n ");
}
else if (self.menu == 2)
{
centerprint(self,"Select a Team\n Allied\n>Axis\n ");
}
else if (self.menu == 3)
{
centerprint(self,"Select a Class\n>Class1\n Class2\n Class3\n ");
}
else if (self.menu == 4)
{
centerprint(self,"Select a Class\n Class1\n>Class2\n Class3\n ");
}
else if (self.menu == 5)
{
centerprint(self,"Select a Class\n Class1\n Class2\n>Class3\n ");
}
};
this in playerprethink:
Code: Select all
if(self.menu)//*ceriux*
{
self.velocity_x = 0;
self.velocity_y = 0; // if the menu is up you cant move *ceriux*
self.velocity_z = 0;
Menus();
Menu_Update();
}//*ceriux*
Code: Select all
if (self.menu > 0)
{
Menu_Select(); // if the menu is up use this function instead. *ceriux*
}