Author |
Topic: Opening menu after weapon selection |
|
|
liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Monday, Jan. 17, 2011 04:47 pm |
|
i would really not like credit for ZombieNation for i did not like what they did to the mod when i left the group. anways its very simple i recommend you pick a model first then pick a weapon. i think your code would be alot less confusing that way and what you do to do that is open your gametypes .gsc and find menuAllies or menuAxis depends what team you want to do it for. and where it says
Code: if(!isdefined(self.pers["weapon"]))
self openMenu(game["menu_weapon_axis"]);
just change it to your model menu.
if then after your responses you should make sure to then open the menu_weapon_axis or allies what ever may be the case and then let them pick a weapon and they will spawn with there weapon. the whole spawning as a model though you may want to save your responses in a var then in spawnPlayer() you should then check what response that was and then make the player that model. |
|
|
|
|
|
liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Monday, Jan. 17, 2011 04:58 pm |
|
ah if you want the menu to open on spawn, then you just go to the spawnPlayer() func and inside there defined what team you want the menu to open for and so quick example would be.
Code: if(self.pers["team"] == "allies")
self openMenu(game["menu_modelselect"]);
if you want it for axis simply change allies to axis. |
|
|
|
|
|
liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
|
|
|
Category: CoD2 Scripting Posted: Tuesday, Jan. 18, 2011 10:14 am |
|
This is in Callback_PlayerConnect()
Code: if(self.pers["team"] == "allies")
{
self openMenu(game["menu_modelselect1"]);
scriptMainMenu = game["menu_modelselect1"];
self openMenu(game["menu_weapon_allies"]);
scriptMainMenu = game["menu_weapon_allies"];
}
In the MenuAllies()
Code: if(!isdefined(self.pers["weapon"]))
{
self openMenu(game["menu_modelselect1"]);
self openMenu(game["menu_weapon_allies"]);
}
And this is in the ZomMenuAutoAssign()
Code: if(assignment == self.pers["team"] && (self.sessionstate == "playing" || self.sessionstate == "dead"))
{
if(!isdefined(self.pers["weapon"]))
{
if(self.pers["team"] == "allies")
{
self openMenu(game["menu_modelselect1"]);
self openMenu(game["menu_weapon_allies"]);
}
But no menu opens. And also no error is given |
|
|
|
liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Tuesday, Jan. 18, 2011 05:03 pm |
|
alot of things wrong here. first off in the Code: Callback_PlayerConnect() you are using Code: if(self.pers["team"] == "allies") i dont know about you. but when i first connect into a server i dont think i picked a team yet... so thats not going to work. second in your Code: MenuAllies() you are opening 2 menus at once i dont even know how that even plays out but yeah thats no good if you ask me and same with the Code: ZomMenuAutoAssign() you are opening 2 menus at once. it seems like you may have skimmed threw what i previously said 2 posts ago i believe i said you should open up the model menu first so take out the whole Code: menu_weapon_axis and just have your Code: menu_modelselect1 and then when you get that menu to open you want to make sure when you pick your model catch the response in _menus.gsc and then open the Code: menu_weapon_axis or allies w.e the case may be. |
|
|
|
|
|
liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
|
|