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

Members Online

»
0 Active | 69 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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
Page
Previous Page Next Page
subscribe
Author Topic: Opening menu after weapon selection
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Monday, Jan. 17, 2011 03:32 pm
The menu doesnt open after choosing your weapon.
liltc64, can't you help me? You had it in ZombieNation mod right?
Just point me in the right direction
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
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.
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Monday, Jan. 17, 2011 04:53 pm
But than you first spawn with weapon and after that it will open the menu right?
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
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.
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Monday, Jan. 17, 2011 05:32 pm
It has to open before spawn. After you choose your model you spawn;)
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Jan. 17, 2011 05:44 pm
right then follow the steps i gave you before.
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
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
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
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.
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Jan. 19, 2011 07:23 pm
I can't figure it out... Also because my English isn't very good.
Can you please post a full example how you did it in ZombieNation?
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Jan. 19, 2011 11:29 pm
i just gave you a full example on what to do, and i cant give you any code from ZN promised my team i would never and i wouldnt anyways.
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
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

»