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

Members Online

»
0 Active | 68 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
Next 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: Monday, Aug. 22, 2011 01:39 pm
Hello everyone,

I have a problem with a script when I have too many players here a server bug in the Screen error.

Sorry for my English I am French: s

http://screenshot.xfire.com/s/117215962-4.jpg
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Thursday, Aug. 25, 2011 07:13 pm
up
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 Scripting
Posted: Friday, Aug. 26, 2011 09:34 am
So, what does that have to do with the topic's title ?
Do you have a radio script in your map/mod ? If so, what is it ?
You'll have to give some more info.
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: Friday, Aug. 26, 2011 09:52 am
Are you constantly calling SetText() on a hud element?
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Aug. 26, 2011 01:32 pm
Me Script :

ShowKDRatio()
{
if (isDefined(self.mc_kdratio))
self.mc_kdratio destroy();

wait .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);

for (;;)
{
text = "^2K\\D Ratio: ^10";

if (isDefined(self))
{
kills = self.pers["kills"];
deaths = self.pers["deaths"];

if (isDefined(kills) && isDefined(deaths))
{
if (deaths < 1)
deaths = 1;

if (kills < 1)
ratio = 0;
else
ratio = kills / deaths;

if (ratio >= 1)
text = "^2K\\D Ratio: " + ratio + " K: " + kills + " D: " + deaths;
else
text = "^2K\\D Ratio: ^1" + ratio + " K: " + kills + " D: " + deaths;
}
}

self.mc_kdratio setText( text );
wait 0.05;
}
}


sorry for the title I was wrong
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: Friday, Aug. 26, 2011 06:24 pm
Instead of calling SetText() every frame, try doing it just when player gets a kill / dies.
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Aug. 26, 2011 08:11 pm
can you help me do this? it's a script I found on google. I do not see how it pls
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD4 Scripting
Posted: Friday, Aug. 26, 2011 08:24 pm
Try using 3 huds with .label and setvalue() for each of them.
Share |
splash93
General Member
Since: Aug 22, 2011
Posts: 25
Last: Dec 20, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Aug. 26, 2011 08:29 pm
can you help me do this?
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 01:52 am
Just thread this on each player once and it'll last the whole game or until they leave match.

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 = "^2K\\D Ratio: ^1";

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

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

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

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

		wait ( 0.05 );
	}
}

waittill_either( msg1, msg2 )
{
	self endon( msg1 );
	self waittill( msg2 );
}
Share |
Restricted Access Topic is Locked
Page
Next 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

»