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

Members Online

»
0 Active | 43 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 General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Money Scripts (Help)!
koen80
General Member
Since: Jun 20, 2008
Posts: 23
Last: Oct 26, 2010
[view latest posts]
Level 1
Category: CoD2 General
Posted: Saturday, Sep. 26, 2009 07:57 pm
Can someone help me with a money script??
for my mod

self.money

that's all i have.
can someone work it out for me?
Share |
koen80
General Member
Since: Jun 20, 2008
Posts: 23
Last: Oct 26, 2010
[view latest posts]
Level 1
Category: CoD2 General
Posted: Sunday, Sep. 27, 2009 01:20 pm
Can somebody help me please. im stuck with my mod.
Share |
Kylee
General Member
Since: Aug 3, 2009
Posts: 56
Last: Apr 5, 2010
[view latest posts]
Level 3
Category: CoD2 General
Posted: Sunday, Sep. 27, 2009 02:19 pm
Try looking at the BTD mods? They use money scripts. Im sure if you asked they would by pleased to help.

http://www.before-dawn.co.uk/dawn/news.php
Share |
codmp
General Member
Since: Feb 7, 2006
Posts: 905
Last: Aug 1, 2011
[view latest posts]
Level 7
Category: CoD2 General
Posted: Sunday, Sep. 27, 2009 03:19 pm
What kind of mod are you doing?
Share |
koen80
General Member
Since: Jun 20, 2008
Posts: 23
Last: Oct 26, 2010
[view latest posts]
Level 1
Category: CoD2 General
Posted: Sunday, Sep. 27, 2009 04:16 pm
It's Gametype Domination, with Quickmessage Menu,
With shop in it.

Refill Ammo = €500,-
Refill Grenades = €400,-
Refill SmokeGrenades = 800,-

Get it?
Share |
GFx3r0zombie666
General Member
Since: Jul 15, 2011
Posts: 5
Last: Jul 16, 2011
[view latest posts]
Level 0
Category: CoD2 General
Posted: Saturday, Jul. 16, 2011 02:37 am
koen80 writes...
Quote:
It's Gametype Domination, with Quickmessage Menu,
With shop in it.

Refill Ammo = €500,-
Refill Grenades = €400,-
Refill SmokeGrenades = 800,-

Get it?


This is exactly what I would like to make as well.
If anyone can help or post some feedback I would be thankful.
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 General
Posted: Saturday, Jul. 16, 2011 10:45 am
i wrote something, hope4 it helps

Code:

/*=============================================
	>>Qickmenu - Shop<<

	call this on the gametypes start, where all other init's are located
	you have to create a new menu in the menufiles (menu/scriptmenu) before
	call the menu "shopmenu"
	for every shopitem there have to be a scriptmenuresponse with: "shopitem_1","shopitem_2", and so on
	dont forget to precache the menu
	
	link: http://wiki.modsrepository.com/index.php/Call_of_Duty_5:_Menu_Modding_Basics

	there might be some syntax errors, post on modsonline for help
	hope it helps a little

	xf: serthy
=============================================*/
	

init()
{
	game["menu_shop"] = "shopmenu";	//declare the shopmenu
	precacheMenu(game["menu_shop"]);	//precache the shopmenu

	precahceString( &"Money: " );		//for money hud (need to have a [&] before!

	level OnPlayerConnecting();
}

OnPlayerConnecting()				//everytime a player is connecting...
{
	level endon( "intermission" );

	for( ; ; )
	{
		level waittill( "connecting" , player );
	
		if( isDefined( player ) && isPlayer( player ) )
			player thread OnPlayerConnected();
	}
}

OnPlayerConnected()				//...run this on the player
{
	self endon( "disconnect" );

	wait 1;

	self.pers["money"] = 0;			// initialise his money on connecting to zero
	self thread MoneyScreen();		//call the money hud
	
	for( ; ; )
	{
		self waittill( "menuresponse" , menu , response );		// everytime there is a menuresponse ( ex: quickmenu )
	
		if( menu != game["menu_shop"] )					//if the menu is our shop, else continue waiting
			continue;
	
		thread quickshop( response );						//start the shop function depending on the response
	}
}

quickshop( response )
{
	if( !isdefined( self.pers["team"] ) || self.pers["team"] == "spectator" || isdefined( self.spamdelay ) )
		return;		// if the player is not allowed to use the shop

	self.spamdelay = true;	//this stops the player abusing the shop

	if( self.pers["team"] == "allies" )		//if the player is a hunter
	{
		switch( response )
		{
			case "shopitem_1":			// shopitem_1 : you can call it whatever you want (depending on the scriptmenuresponse on menu-file
				self thread hunter_mine();	// then thread that what you want to give the shopuser
				break;
			case "shopitem_2":
				self thread hunter_healthpack();
				break;
			default:
				break;
		}
	}
	else if( self.pers["team"] == "axis" )		//same with zombies
	{
		switch( response )
		{
			case "shopitem_1":
				self thread zombie_jump();
				break;
			case "shopitem_2":
				self thread zombie_explode();
				break;
			default:
				break;
		}
	}
	//you need to continue this to have more items on your shop
}

hunter_mine()	//example for one shopitem
{
	if( !isDefined( self.pers["money"] || self.pers["team != "allies"] )	//if the user dont have money or is in the wron team, quit
		return;

	if( self.pers["money"] >= level.price["mine"] )		//if the user has enough money
	{
		self.pers["money"] -= level.price["mine"];	//sell the item

		if( isDefined( self.mines ) )				//give the item
			self.mines++;
		else 	self.mines = 1;
		
		self iprintlnBold( "^2You bought a mine ^1(-" + level.price["mine"] + ")" );	//say it to the user
	}
	else
	{
		self iprintlnBold( "^1You don't have enough Money to buy this!" );		//else he does not have enough money
	}
}

hunter_healthpack()
{
	//same with the other items
}

zombie_jump()
{

}

zombie_explode()
{

}
	
MoneyScreen()
{
	self endon( "disconnect" );
	
	self.hud_money 			= newHudElem( self );
	self.hud_money.x 			= 500;			// the x position on screen [ range 0 - 640 ]
	self.hud_money.y 			= 300;			// the y position on screen [ range 0 - 480 ]
	self.hud_money.fontsize 	= 2;				// the size of the text/number
	self.hud_money.color 		= ( 0 , 1 , 0 );		// color in [ ( red , blue , green ) range 0 - 1 ]
	self.hud_money.sort 		= 9998;
	self.hud_money.alpha		= 1;				// visibility [ range 0 - 1 ]
	self.hud_money.label 		= &"Money: ";		// the text (must be precahced)

	while( isDefined( self.hud_money ) )
	{
		wait 1;	
		self.hud_money setValue( self.pers["money"] );	// updates the money every second
	}
}
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 General

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

»