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

Members Online

»
0 Active | 65 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 subscribe
Author Topic: Question about iPrintlnBold
Synister
General Member
Since: Jan 21, 2008
Posts: 11
Last: Jul 20, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 03:28 am
Is it possible to show a palyers name in the
iPrintlnBold Message..

Example

iPrintlnBold("[PLAYERNAME] Was Just took the objective");
Share |
sevensniff
General Member
Since: Feb 12, 2005
Posts: 365
Last: Apr 8, 2010
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 03:34 am
Code:
iprintlnBold(self.name + "Just took the objective");


should do the trick. [cool]
Share |
Synister
General Member
Since: Jan 21, 2008
Posts: 11
Last: Jul 20, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 03:43 am
Nope that didnt work.... It errors on that command now.
Share |
sevensniff
General Member
Since: Feb 12, 2005
Posts: 365
Last: Apr 8, 2010
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 04:01 am
show us ur script. can rework it to work with yours.
Share |
Synister
General Member
Since: Jan 21, 2008
Posts: 11
Last: Jul 20, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 04:41 am
Code:


main()
{
thread scripted_msg1();
}

scripted_msg1()
{
print_msg1 = getentarray("print_msg1","targetname");
for(i=0;i<print_msg1.size;i++)
print_msg1[i] thread trigger_messages();
}

trigger_messages()
{
	while(1)
	{
		self waittill("trigger",player);	// Wait until triggered
		if(player.sessionstate != "playing")
			continue;

		if(isDefined(player.triggered_1))
			continue;

		iPrintlnBold("MESSAGE HERE");

		player.triggered_1 = true;

		player thread waittilloutoftrig(self);
	}
}

waittilloutoftrig(trig)
{
	self endon("disconnect");
	while(self isTouching(trig))	// While the player is touching the trigger stay here
		wait 0.05;
	self.triggered_1 = undefined;
}




Trigger type is Trigger_Multible
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 09:43 am
and what is the exact error you're getting?
Share |
Kamero
General Member
Since: Apr 29, 2006
Posts: 3
Last: Jul 24, 2009
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 10:03 am
in first - sorry for my bad english!

Dont do an String-Addition in an output-command! Its wrong code!

do this so:

strg = player.name + "Text, you will";
iPrintLnBold(strg);

this should work - im my mind[thumbs_up]
Share |
KD
General Member
Since: Jul 13, 2008
Posts: 29
Last: Jul 24, 2008
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 10:20 am
iPrintlnBold(player.name + " was here");

will work
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 12:23 pm
Kamero writes...
Quote:
in first - sorry for my bad english!

Dont do an String-Addition in an output-command! Its wrong code!

do this so:

strg = player.name + "Text, you will";
iPrintLnBold(strg);

this should work - im my mind[thumbs_up]


Well, actually that is not correct. It will work as stated above, Ive been using it in AWE4 since COD4 first came out.

This -

Quote:
iprintlnBold(self.name + "Just took the objective");


- works fine "as is".

However, its important to note that you do have to put these 2 settings in your server config file:

set loc_warnings 0
set loc_warningsAsErrors 0

That stops the server spitting out error messages that your strings are not localized.

If you want to go the whole hog and do it properly, you can localize your strings and still get a player name in -

From my AWE4 disarm explosives code:

Quote:
precacheString( &"MP_EXPLOSIVES_DEFUSED_BY" );


Quote:
if ( typeOfAction == "disarming" )
self iprintlnBold( &"MP_EXPLOSIVES_DEFUSED_BY", self.name );


String:
Quote:
REFERENCE EXPLOSIVES_DEFUSED_BY
LANG_ENGLISH "&&1 defused the explosives!"


&&1 picks up player.name/self.name and prints it to center screen.

edited on Jul. 20, 2008 08:25 am by Tally

edited on Jul. 20, 2008 08:26 am by Tally
Share |
Synister
General Member
Since: Jan 21, 2008
Posts: 11
Last: Jul 20, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Sunday, Jul. 20, 2008 12:26 pm
Ok It works now.. TY.. I had a typo.
Share |
Restricted Access Topic is Locked 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

»