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

Members Online

»
0 Active | 101 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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page
subscribe
Author Topic: script radio
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Aug. 27, 2011 01:14 pm
A big thank you to you. I will test
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Aug. 27, 2011 01:20 pm
its not working. the ratio appears more
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Aug. 27, 2011 06:24 pm
The .label needs to be a localized string, so I used MENU_RATIO. You can make your own and tie it in to the script if you wish.

I also changed the callback notify it checks for when you kill a player.

I tried this with Pezbot and it works:

Code:
ShowKDRatio()
{
	self notify( "new_KDRRatio" );
	self endon( "new_KDRRatio" );
	self endon( "disconnect" );

	if( IsDefined( self.mc_kdratio ) )
	{
		self.mc_kdratio Destroy();
	}

	wait ( 0.05 );

	self.mc_kdratio = NewClientHudElem(self);
	self.mc_kdratio.x = 7;
	self.mc_kdratio.y = 180;
	self.mc_kdratio.horzAlign = "left";
	self.mc_kdratio.vertAlign = "top";
	self.mc_kdratio.alignX = "left";
	self.mc_kdratio.alignY = "middle";
	self.mc_kdratio.alpha = 1;
	self.mc_kdratio.fontScale = 1.4;
	self.mc_kdratio.hidewheninmenu = true;
	self.mc_kdratio.color = (.99, .99, .75);
	self.mc_kdratio.label = &"MENU_RATIO";

	while( true )
	{
		ratio = 0.0;
		
		self waittill_either( "death", "playerKilledChallengesProcessed" );

		kills = self.pers[ "kills" ];
		deaths = self.pers[ "deaths" ];

		if( IsDefined( kills ) && IsDefined( deaths ) )
		{
			if( deaths < 1 )
			{
				deaths = 1;
			}

			if( kills > 0 )
			{
				ratio = itof( kills ) / itof( deaths );
			}
		}
		
		self.mc_kdratio SetValue( ratio );

		wait ( 0.05 );
	}
}

waittill_either( msg1, msg2 )
{
	self endon( msg1 );
	self waittill( msg2 );
}

itof( int )
{
	SetDvar( "temp_float", int );
	return GetDvarFloat( "temp_float" );
}


Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Aug. 27, 2011 08:28 pm
still do not want displayed on my mod

I have to launch mid: self ShowKDRatio ();

a big thank you for taking your time to help me
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Aug. 27, 2011 08:42 pm
it's good it works a big thank you





edited on Aug. 27, 2011 04:43 pm by splash93

can you tell me why, but his report
Share |
Restricted Access Topic is Locked
Page
Previous Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»