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

Members Online

»
0 Active | 53 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 subscribe
Author Topic: Another money script made by self - need help!
KillerGuy790831
General Member
Since: Aug 29, 2012
Posts: 10
Last: Sep 22, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Friday, Sep. 21, 2012 03:15 pm
Well, hi there again... Sorry, I'm really lacking of time... Well, I created another money script by myself...

What I wanted to do:
1). Create a new variable: self.money;
2). Create a hud-icon for it;
3). When a player kills an emeny player, he gets +50 to self.money; -25 for suicide or a teammate kil;
4). self.money goes to zero when a player gets killed, joins another team or disconnects and updates it's own and it's hud-relative value after every kill.

What I tried to script:

Code:

init()
{
	while(1)
	{
		level waittill("connected",player);			/* Wait untill someone joins */
		player thread createHud();				/* Go to createHud() function (for a player) */
	}
}

createHud()
{
	precacheString(&"^1Your current money is:")			/* I don't know if it is necessary */
//	player endon("killed_player");				
//	player endon("disconnect");				
//	player endon("join");			

	if(!isdefined(self.hud_money))					/* Not defined anyway */
	{	
		self.hud_money destroy();
		self.hud_money = newClientHudElem(self);
		self.hud_money.alignx = "right";
		self.hud_money.x = 622;
		self.hud_money.y = 200;
		self.hud_money.label = &"^1Your current money is:";
	}
	if(!isdefined(self.money))
	{
		self.money = moneySelf;
		moneySelf = 0;						/* Variable not defined actually ;( */
	}
}


Certainly it's just a piece of.... yes... But may be than I'll manage to understand something... I hope.

P.S. Yes, I DO have _cash.gsc script for money... But I just don't understand how the hell it works...
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Sep. 21, 2012 04:40 pm
read http://modsonline.com/Forums-top-134675.html
Share |
KillerGuy790831
General Member
Since: Aug 29, 2012
Posts: 10
Last: Sep 22, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Saturday, Sep. 22, 2012 07:04 pm
Ehm... really thanks, but still didn't get much...
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, Sep. 24, 2012 01:08 am
http://modsonline.com/Forums-top-163067.html[eek][eek][eek][wave]
Share |
Restricted Access Topic is Locked 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

»